Skip to content

Commit 7aa4855

Browse files
committed
Explicitly set DPI in label
1 parent d7aab56 commit 7aa4855

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = 'com.labelzoom.api'
9-
version = '1.1.0'
9+
version = '1.2.0'
1010

1111
java {
1212
sourceCompatibility = JavaVersion.VERSION_1_8

src/main/java/com/labelzoom/api/model/components/CLabel.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class CLabel
2727
private int height;
2828

2929
@Getter @Setter
30-
private boolean isHighRes = false;
30+
private int dpi = 100;
3131

3232
@Getter @Setter
3333
private PageOrientation orientation = PageOrientation.Portrait;
@@ -82,7 +82,7 @@ protected CLabel(final CLabel original, final boolean cloneData)
8282
{
8383
width = original.getWidth();
8484
height = original.getHeight();
85-
isHighRes = original.isHighRes();
85+
dpi = original.getDpi();
8686
orientation = original.getOrientation();
8787
if (original.getLayers() != null)
8888
{
@@ -108,6 +108,9 @@ protected CLabel(final CLabel original, final boolean cloneData)
108108
}
109109
}
110110

111+
public boolean isHighRes() { return dpi >= 1000; }
112+
public void setHighRes(final boolean isHighRes) { dpi = isHighRes ? 1000 : 100; }
113+
111114
public void setElements(final List<AComponent> elements) { getLayerMap().get(DEFAULT_LAYER_NAME).setElements(elements); } // TODO: Multi-layer support
112115
public List<AComponent> getElements() { return getLayerMap().get(DEFAULT_LAYER_NAME).getElements(); } // TODO: Multi-layer support
113116

@@ -199,9 +202,4 @@ public List<AComponent> getSortedElements()
199202
else if (!c1.isReverse() && c2.isReverse()) return -1;
200203
return Integer.compare(this.getElements().indexOf(c1), this.getElements().indexOf(c2));
201204
};
202-
203-
public int getDpi()
204-
{
205-
return isHighRes ? 1000 : 100;
206-
}
207205
}

0 commit comments

Comments
 (0)