Browse Source

Fix font size not following DPI in the code editor

Stan Hebben 6 years ago
parent
commit
17338a30b3

+ 1
- 1
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingDrawnRectangle.java View File

@@ -53,6 +53,6 @@ public class SwingDrawnRectangle extends SwingDrawnElement implements DDrawnRect
53 53
 	public void paint(Graphics2D g, DIRectangle clip) {
54 54
 		g.setColor(awtColor);
55 55
 		g.fillRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
56
-		g.fillRect(clip.x, clip.y, 3, 3);
56
+		//g.fillRect(clip.x, clip.y, 3, 3);
57 57
 	}
58 58
 }

+ 0
- 1
DrawableGui/src/main/java/org/openzen/drawablegui/tree/DTreeView.java View File

@@ -20,7 +20,6 @@ import org.openzen.drawablegui.DDrawableInstance;
20 20
 import org.openzen.drawablegui.Destructible;
21 21
 import org.openzen.drawablegui.listeners.ListenerHandle;
22 22
 import org.openzen.drawablegui.live.LiveBool;
23
-import org.openzen.drawablegui.draw.DDrawSurface;
24 23
 import org.openzen.drawablegui.draw.DDrawnRectangle;
25 24
 import org.openzen.drawablegui.draw.DDrawnText;
26 25
 import org.openzen.drawablegui.live.LiveList;

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

@@ -52,7 +52,6 @@ import org.openzen.zenscript.ide.ui.view.IconButtonControl;
52 52
  */
53 53
 public class SourceEditor implements DComponent {
54 54
 	private final DStyleClass styleClass;
55
-	private final DFont font = new DFont(DFontFamily.CODE, false, false, false, 24);
56 55
 	private final MutableLiveObject<DSizing> sizing = DSizing.create();
57 56
 	private final String tab = "    ";
58 57
 	private final IDESourceFile sourceFile;
@@ -65,6 +64,7 @@ public class SourceEditor implements DComponent {
65 64
 	private SourceEditorStyle style;
66 65
 	private DTimerHandle blinkTimer;
67 66
 	
67
+	private DFont font;
68 68
 	private DFontMetrics fontMetrics;
69 69
 	private int textLineHeight;
70 70
 	private int fullLineHeight;
@@ -140,6 +140,7 @@ public class SourceEditor implements DComponent {
140 140
 		
141 141
 		context = parent.getChildContext("sourceeditor", styleClass);
142 142
 		style = context.getStyle(SourceEditorStyle::new);
143
+		font = new DFont(DFontFamily.CODE, false, false, false, (int)(context.getScale() * 13.7 + 0.5f));
143 144
 		
144 145
 		fontMetrics = context.getFontMetrics(font);
145 146
 		textLineHeight = fontMetrics.getAscent() + fontMetrics.getDescent();

Loading…
Cancel
Save