Skip to content

Commit

Permalink
Explicitly set DPI in label
Browse files Browse the repository at this point in the history
  • Loading branch information
RobFaustLZ committed Jun 28, 2024
1 parent d7aab56 commit 7aa4855
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'com.labelzoom.api'
version = '1.1.0'
version = '1.2.0'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/com/labelzoom/api/model/components/CLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class CLabel
private int height;

@Getter @Setter
private boolean isHighRes = false;
private int dpi = 100;

@Getter @Setter
private PageOrientation orientation = PageOrientation.Portrait;
Expand Down Expand Up @@ -82,7 +82,7 @@ protected CLabel(final CLabel original, final boolean cloneData)
{
width = original.getWidth();
height = original.getHeight();
isHighRes = original.isHighRes();
dpi = original.getDpi();
orientation = original.getOrientation();
if (original.getLayers() != null)
{
Expand All @@ -108,6 +108,9 @@ protected CLabel(final CLabel original, final boolean cloneData)
}
}

public boolean isHighRes() { return dpi >= 1000; }
public void setHighRes(final boolean isHighRes) { dpi = isHighRes ? 1000 : 100; }

public void setElements(final List<AComponent> elements) { getLayerMap().get(DEFAULT_LAYER_NAME).setElements(elements); } // TODO: Multi-layer support
public List<AComponent> getElements() { return getLayerMap().get(DEFAULT_LAYER_NAME).getElements(); } // TODO: Multi-layer support

Expand Down Expand Up @@ -199,9 +202,4 @@ public List<AComponent> getSortedElements()
else if (!c1.isReverse() && c2.isReverse()) return -1;
return Integer.compare(this.getElements().indexOf(c1), this.getElements().indexOf(c2));
};

public int getDpi()
{
return isHighRes ? 1000 : 100;
}
}

0 comments on commit 7aa4855

Please sign in to comment.