mirror of
https://github.com/wez/wezterm.git
synced 2025-01-02 18:51:38 +03:00
software: pre-scale emoji so they render more reasonably
Since we don't have a draw-image-and-rescale primitive, and since we'd have to scale every time we drew the glyph, it makes sense to cache the pre-scaled glyph in the atlas.
This commit is contained in:
parent
389c477b16
commit
40d7186a9c
@ -747,11 +747,17 @@ impl TermWindow {
|
||||
&glyph.data,
|
||||
);
|
||||
|
||||
let tex = self.atlas.borrow_mut().allocate(&raw_im)?;
|
||||
|
||||
let bearing_x = glyph.bearing_x * scale;
|
||||
let bearing_y = glyph.bearing_y * scale;
|
||||
|
||||
let (scale, raw_im) = if scale != 1.0 {
|
||||
(1.0, raw_im.scale_by(scale))
|
||||
} else {
|
||||
(scale, raw_im)
|
||||
};
|
||||
|
||||
let tex = self.atlas.borrow_mut().allocate(&raw_im)?;
|
||||
|
||||
CachedGlyph {
|
||||
texture: Some(tex),
|
||||
x_offset,
|
||||
|
Loading…
Reference in New Issue
Block a user