Skip to content

Commit 542b41e

Browse files
committed
Fix blurry rendering for [note] and [messbox]
1 parent 5670850 commit 542b41e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Source/Objects/MessboxObject.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ class MessboxObject final : public ObjectBase
129129
imageRenderer.renderJUCEComponent(nvg, editor, scale);
130130
needsRepaint = false;
131131
} else {
132-
imageRenderer.render(nvg, getLocalBounds().withTrimmedRight(5));
132+
NVGScopedState state(nvg);
133+
nvgScale(nvg, 1.0f / scale, 1.0f / scale);
134+
auto w = roundToInt (scale * (float) editor.getWidth());
135+
auto h = roundToInt (scale * (float) editor.getHeight());
136+
imageRenderer.render(nvg, {0, 0, w, h}, true);
133137
}
134138
}
135139

Source/Objects/NoteObject.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ class NoteObject final : public ObjectBase {
134134
imageRenderer.renderJUCEComponent(nvg, noteEditor, scale);
135135
needsRepaint = false;
136136
} else {
137-
imageRenderer.render(nvg, getLocalBounds());
137+
NVGScopedState state(nvg);
138+
nvgScale(nvg, 1.0f / scale, 1.0f / scale);
139+
auto w = roundToInt (scale * (float) noteEditor.getWidth());
140+
auto h = roundToInt (scale * (float) noteEditor.getHeight());
141+
imageRenderer.render(nvg, {0, 0, w, h}, true);
138142
}
139143
}
140144

0 commit comments

Comments
 (0)