Skip to content

Commit

Permalink
text: Use layout coordinate space when rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarosh committed Nov 2, 2024
1 parent 292738a commit c0eb1d2
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions core/src/display_object/edit_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
});

Expand All @@ -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,
Expand Down

0 comments on commit c0eb1d2

Please sign in to comment.