ruffle
ruffle copied to clipboard
render,core: Improve EditText's border and background rendering
This PR removes the drawing used for rendering the border and the background and renders them using primitives instead.
It provides two methods for drawing the border and the background:
-
draw_device_text_box
-- when device fonts are used, -
draw_text_box
-- when fonts are embedded.
In order to draw the border properly new methods have been added:
-
draw_line
-- for drawing a single line (always 1px thick), -
draw_line_rect
-- for drawing a rectangle using lines (always 1px thick).
These primitives have been implemented for wgpu, WebGL, and canvas.
Before | After |
---|---|
Additional notes:
-
draw_line
added in this PR may also be used for rendering the selection caret in the future.
Related to https://github.com/ruffle-rs/ruffle/issues/15003, https://github.com/ruffle-rs/ruffle/issues/1881 (the border is not being transformed anymore).