Browse Source

Another attempt at scaling icons correctly.

Stan Hebben 6 years ago
parent
commit
df5faae297

+ 6
- 4
DrawableGui/src/main/java/org/openzen/drawablegui/tree/DTreeView.java View File

289
 			int baseY = (int)(bounds.y + style.padding + index * (fontMetrics.getAscent() + fontMetrics.getDescent() + style.rowSpacing));
289
 			int baseY = (int)(bounds.y + style.padding + index * (fontMetrics.getAscent() + fontMetrics.getDescent() + style.rowSpacing));
290
 			
290
 			
291
 			if (collapseIcon != null) {
291
 			if (collapseIcon != null) {
292
-				collapseIcon.setTransform(DTransform2D.translate(
292
+				collapseIcon.setTransform(DTransform2D.scaleAndTranslate(
293
 						baseX,
293
 						baseX,
294
-						baseY + fontMetrics.getAscent() + fontMetrics.getDescent() - icon.getNominalHeight()));
294
+						baseY + fontMetrics.getAscent() + fontMetrics.getDescent() - icon.getNominalHeight(),
295
+						iconScale));
295
 			}
296
 			}
296
-			nodeIcon.setTransform(DTransform2D.translate(
297
+			nodeIcon.setTransform(DTransform2D.scaleAndTranslate(
297
 					baseX + icon.getNominalWidth() + style.iconTextSpacing,
298
 					baseX + icon.getNominalWidth() + style.iconTextSpacing,
298
-					baseY + fontMetrics.getAscent() + fontMetrics.getDescent() - icon.getNominalHeight()));
299
+					baseY + fontMetrics.getAscent() + fontMetrics.getDescent() - icon.getNominalHeight(),
300
+					iconScale));
299
 			text.setPosition(
301
 			text.setPosition(
300
 					baseX + style.iconTextSpacing + icon.getNominalWidth() + style.iconTextSpacing + node.getIcon().getNominalWidth(),
302
 					baseX + style.iconTextSpacing + icon.getNominalWidth() + style.iconTextSpacing + node.getIcon().getNominalWidth(),
301
 					baseY + fontMetrics.getAscent());
303
 					baseY + fontMetrics.getAscent());

+ 1
- 1
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/TabbedViewTabClose.java View File

47
 		context = parent.getChildContext("tabclose", DStyleClass.EMPTY);
47
 		context = parent.getChildContext("tabclose", DStyleClass.EMPTY);
48
 		style = context.getStyle(TabbedViewTabCloseStyle::new);
48
 		style = context.getStyle(TabbedViewTabCloseStyle::new);
49
 		sizing.setValue(new DSizing(style.size, style.size));
49
 		sizing.setValue(new DSizing(style.size, style.size));
50
-		icon = new ScalableCloseIcon(style.size / 24);
50
+		icon = new ScalableCloseIcon(style.size / 24 * parent.getScale() / 1.75f);
51
 		
51
 		
52
 		if (background != null)
52
 		if (background != null)
53
 			background.close();
53
 			background.close();

Loading…
Cancel
Save