Fix max range, range cursor, and stc range control readouts

This commit is contained in:
2026-06-19 08:50:59 -07:00
parent 2f8a3706c5
commit 200778af26
9 changed files with 286 additions and 63 deletions

View File

@@ -78,6 +78,14 @@ public:
/* Return the rendered pixel width of text at the given scale. */
float get_text_width(const std::string& text, float scale) const;
/* Render text at (x, y), wrapping on word boundaries when a line would
* exceed max_width pixels. y is decremented by line_height * scale after
* each rendered line, including the last. Never breaks within a word. */
void render_text_wrapped(const std::string& text,
float x, float& y, float scale,
float max_width, float line_height,
float color_r, float color_g, float color_b);
/* Set the orthographic projection for a viewport of w × h pixels.
* Call this each time glViewport changes before rendering text. */
void set_projection(int w, int h);