1
0
Fork 0
forked from wry/wry

renderer: move boxes before scaling them

This commit is contained in:
Julian Orth 2026-03-13 15:30:20 +01:00
parent 479d2171b7
commit c9a348337c
2 changed files with 15 additions and 17 deletions

View file

@ -89,7 +89,7 @@ impl RendererBase<'_> {
self.fill_boxes3(boxes, color, None, cd, dx, dy, false);
}
pub fn fill_boxes3(
fn fill_boxes3(
&mut self,
boxes: &[Rect],
color: &Color,
@ -102,18 +102,18 @@ impl RendererBase<'_> {
if boxes.is_empty() || *color == Color::TRANSPARENT {
return;
}
let (dx, dy) = self.scale_point(dx, dy);
for bx in boxes {
let bx = bx.move_(dx, dy);
let bx = match scaled {
false => self.scale_rect(*bx),
true => *bx,
false => self.scale_rect(bx),
true => bx,
};
self.ops.push(GfxApiOpt::FillRect(FillRect {
rect: FramebufferRect::new(
(bx.x1() + dx) as f32,
(bx.y1() + dy) as f32,
(bx.x2() + dx) as f32,
(bx.y2() + dy) as f32,
bx.x1() as f32,
bx.y1() as f32,
bx.x2() as f32,
bx.y2() as f32,
self.transform,
self.fb_width,
self.fb_height,