mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Simplify rendering interface
Instead of passing through a generic transformation matrix, let's just pass through what we actually use: a translation point
This commit is contained in:
parent
d4f603246c
commit
607fecdb18
3 changed files with 11 additions and 14 deletions
|
@ -820,10 +820,11 @@ impl GraphicsFrame for GLFrame {
|
|||
fn render_primitive(
|
||||
&mut self,
|
||||
primitive: &OpaqueRenderingPrimitive,
|
||||
transform: &Matrix4<f32>,
|
||||
translation: Point,
|
||||
variables: RenderingVariables,
|
||||
) -> Vec<OpaqueRenderingPrimitive> {
|
||||
let mut matrix = self.root_matrix * transform;
|
||||
let mut matrix = self.root_matrix
|
||||
* Matrix4::from_translation(cgmath::Vector3::new(translation.x, translation.y, 0.));
|
||||
|
||||
if let RenderingVariables::Text { translate, .. } = &variables {
|
||||
matrix = matrix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue