|
@@ -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();
|