Skip to content

Commit 95bc34e

Browse files
ogoffarttronical
authored andcommitted
femtovg: fix warning about unused variable
The layer_origin should normally always be 0,0 for the Clip element since the Clip element always cover its parent. But the correct thing to do is anyway to translate by the origin.
1 parent 1b5f443 commit 95bc34e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/renderers/femtovg/itemrenderer.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,10 @@ impl<'a, R: femtovg::Renderer + TextureImporter> ItemRenderer for GLItemRenderer
690690
self.scale_factor,
691691
);
692692

693-
self.canvas.borrow_mut().fill_path(&layer_path, &layer_image_paint);
693+
self.canvas.borrow_mut().save_with(|canvas| {
694+
canvas.translate(layer_origin.x, layer_origin.y);
695+
canvas.fill_path(&layer_path, &layer_image_paint);
696+
});
694697
}
695698

696699
RenderingResult::ContinueRenderingWithoutChildren

0 commit comments

Comments
 (0)