Skip to content

Commit 224afa3

Browse files
author
Jesse
committed
Fixed scaling if ruler unit not pixels
1 parent ffbb437 commit 224afa3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

us-android-export.jsx

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*!
1+
/*!
22
* Android Assets for Photoshop
33
* =============================
44
*
@@ -23,6 +23,13 @@ init();
2323

2424
// The other functions
2525
function init() {
26+
27+
// save current ruler unit settings, so we can restore it
28+
var ru = app.preferences.rulerUnits;
29+
30+
// set ruler units to pixel to ensure scaling works as expected
31+
app.preferences.rulerUnits = Units.PIXELS;
32+
2633
if(!isDocumentNew()) {
2734
saveFunc('xxhdpi');
2835
saveFunc('xhdpi');
@@ -33,6 +40,8 @@ function init() {
3340
alert("Please save your document before running this script.");
3441
}
3542

43+
// restore old ruler unit settings
44+
app.preferences.rulerUnits = ru;
3645
}
3746

3847
// Test if the document is new (unsaved)

0 commit comments

Comments
 (0)