From 514e18357a209ad64e1cc1abd2bcd261e6cfbd56 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Sat, 2 Nov 2024 09:51:15 +0100 Subject: [PATCH] text: Use layout coordinate space when rendering --- core/src/display_object/edit_text.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/core/src/display_object/edit_text.rs b/core/src/display_object/edit_text.rs index e334d443466e..5cf8f2c166fa 100644 --- a/core/src/display_object/edit_text.rs +++ b/core/src/display_object/edit_text.rs @@ -2369,18 +2369,7 @@ impl<'gc> TDisplayObject<'gc> for EditText<'gc> { context.commands.activate_mask(); context.transform_stack.push(&Transform { - matrix: Matrix::translate(edit_text.bounds.x_min, edit_text.bounds.y_min), - ..Default::default() - }); - - let scroll_offset = edit_text.vertical_scroll_offset(); - // TODO: Where does this come from? How is this different than INTERNAL_PADDING? Does this apply to y as well? - // If this is actually right, offset the border in `redraw_border` instead of doing an extra push. - context.transform_stack.push(&Transform { - matrix: Matrix::translate( - Self::GUTTER - Twips::from_pixels(edit_text.hscroll), - Self::GUTTER - scroll_offset, - ), + matrix: self.layout_to_local_matrix(&edit_text), ..Default::default() }); @@ -2398,8 +2387,6 @@ impl<'gc> TDisplayObject<'gc> for EditText<'gc> { context.transform_stack.pop(); - context.transform_stack.pop(); - context.commands.deactivate_mask(); context.commands.draw_rect( Color::WHITE,