mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
Increase the range of zoom slider for images to 500%
This commit is contained in:
@@ -57,7 +57,7 @@ public class Image extends AbstractTransparentComponent<Void> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static String DEFAULT_TEXT = "Double click to edit text";
|
||||
private static ImageIcon ICON;
|
||||
private static byte DEFAULT_SCALE = 50;
|
||||
private static byte DEFAULT_SCALE = 25;
|
||||
|
||||
static {
|
||||
String name = "image.png";
|
||||
@@ -78,7 +78,8 @@ public class Image extends AbstractTransparentComponent<Void> {
|
||||
@Deprecated
|
||||
private ImageIcon image;
|
||||
private byte[] data;
|
||||
private byte scale = DEFAULT_SCALE;
|
||||
private Byte scale;
|
||||
private byte newScale = DEFAULT_SCALE;
|
||||
|
||||
public Image() {
|
||||
try {
|
||||
@@ -91,7 +92,7 @@ public class Image extends AbstractTransparentComponent<Void> {
|
||||
@Override
|
||||
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
|
||||
IDrawingObserver drawingObserver) {
|
||||
double s = 1d * scale / DEFAULT_SCALE;
|
||||
double s = 1d * getScale() / DEFAULT_SCALE;
|
||||
Shape clip = g2d.getClip().getBounds();
|
||||
if (!clip.intersects(new Rectangle2D.Double(point.getX(), point.getY(), getImage().getIconWidth() * s, getImage()
|
||||
.getIconHeight() * s))) {
|
||||
@@ -171,14 +172,18 @@ public class Image extends AbstractTransparentComponent<Void> {
|
||||
this.image = null;
|
||||
}
|
||||
|
||||
@PercentEditor(_100PercentValue = 50)
|
||||
@PercentEditor(_100PercentValue = 25)
|
||||
@EditableProperty(defaultable = false)
|
||||
public byte getScale() {
|
||||
return scale;
|
||||
if (scale != null) {
|
||||
newScale = (byte) (scale / 2);
|
||||
scale = null;
|
||||
}
|
||||
return newScale;
|
||||
}
|
||||
|
||||
public void setScale(byte scale) {
|
||||
this.scale = scale;
|
||||
this.newScale = scale;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Binary file not shown.
@@ -2496,7 +2496,7 @@
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Allow a file to be loaded if it references a missing component property, but show a warning.</description>
|
||||
<description>Allow a file to be loaded if it references a missing component property, but show a warning</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
@@ -2518,6 +2518,10 @@
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Show wire diameter in mm and in next to AWG gauge</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Increase the range of zoom slider for images to 500%</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
</org.diylc.appframework.update.Version>
|
||||
|
||||
Reference in New Issue
Block a user