Align text position to pixel grid in iced_wgpu
This avoids re-rasterizing glyphs and cache reuploads when the HiDPI factor is nonintegral.
This commit is contained in:
parent
8dc4bd5a1d
commit
5fd0c724b2
1 changed files with 2 additions and 2 deletions
|
|
@ -365,8 +365,8 @@ impl Renderer {
|
|||
// Target physical coordinates directly to avoid blurry text
|
||||
let text = Section {
|
||||
screen_position: (
|
||||
text.screen_position.0 * dpi,
|
||||
text.screen_position.1 * dpi,
|
||||
(text.screen_position.0 * dpi).round(),
|
||||
(text.screen_position.1 * dpi).round(),
|
||||
),
|
||||
bounds: (text.bounds.0 * dpi, text.bounds.1 * dpi),
|
||||
scale: wgpu_glyph::Scale {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue