Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Remove double pointers in EditText #19663

Merged
merged 1 commit into from
Mar 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions core/src/display_object/edit_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ impl<'gc> EditText<'gc> {
Matrix::translate(-tx, -ty)
}

fn local_to_layout(&self, data: &EditTextData, local: Point<Twips>) -> Point<Twips> {
fn local_to_layout(self, data: &EditTextData, local: Point<Twips>) -> Point<Twips> {
self.local_to_layout_matrix(data) * local
}

Expand Down Expand Up @@ -2035,7 +2035,7 @@ impl<'gc> EditText<'gc> {
self.on_changed(&mut activation);
}

fn initialize_as_broadcaster(&self, activation: &mut Avm1Activation<'_, 'gc>) {
fn initialize_as_broadcaster(self, activation: &mut Avm1Activation<'_, 'gc>) {
if let Avm1Value::Object(object) = self.object() {
activation.context.avm1.broadcaster_functions().initialize(
&activation.context.strings,
Expand All @@ -2056,7 +2056,7 @@ impl<'gc> EditText<'gc> {
}
}

fn on_changed(&self, activation: &mut Avm1Activation<'_, 'gc>) {
fn on_changed(self, activation: &mut Avm1Activation<'_, 'gc>) {
if let Avm1Value::Object(object) = self.object() {
let _ = object.call_method(
istr!("broadcastMessage"),
Expand All @@ -2075,7 +2075,7 @@ impl<'gc> EditText<'gc> {
}
}

fn on_scroller(&self, activation: &mut Avm1Activation<'_, 'gc>) {
fn on_scroller(self, activation: &mut Avm1Activation<'_, 'gc>) {
if let Avm1Value::Object(object) = self.object() {
let _ = object.call_method(
istr!("broadcastMessage"),
Expand All @@ -2088,12 +2088,12 @@ impl<'gc> EditText<'gc> {
}

/// Construct the text field's AVM1 representation.
fn construct_as_avm1_object(&self, context: &mut UpdateContext<'gc>, run_frame: bool) {
fn construct_as_avm1_object(self, context: &mut UpdateContext<'gc>, run_frame: bool) {
let mut text = self.0.write(context.gc());
if text.object.is_none() {
let object: Avm1Object<'gc> = Avm1StageObject::for_display_object(
&context.strings,
(*self).into(),
self.into(),
context.avm1.prototypes().text_field,
)
.into();
Expand All @@ -2102,10 +2102,10 @@ impl<'gc> EditText<'gc> {
}
drop(text);

Avm1::run_with_stack_frame_for_display_object((*self).into(), context, |activation| {
Avm1::run_with_stack_frame_for_display_object(self.into(), context, |activation| {
// If this text field has a variable set, initialize text field binding.
if !self.try_bind_text_field_variable(activation, true) {
activation.context.unbound_text_fields.push(*self);
activation.context.unbound_text_fields.push(self);
}
// People can bind to properties of TextFields the same as other display objects.
self.bind_text_field_variables(activation);
Expand All @@ -2120,7 +2120,7 @@ impl<'gc> EditText<'gc> {

/// Construct the text field's AVM2 representation.
fn construct_as_avm2_object(
&self,
self,
context: &mut UpdateContext<'gc>,
display_object: DisplayObject<'gc>,
) {
Expand Down Expand Up @@ -2777,7 +2777,7 @@ impl<'gc> EditText<'gc> {
/// the possible transforms are highly limited),
/// * the current implementation should be pixel-perfect (compared to FP).
pub fn draw_device_text_box(
&self,
self,
context: &mut RenderContext<'_, 'gc>,
bounds: Rectangle<Twips>,
background_color: Option<Color>,
Expand Down Expand Up @@ -2862,7 +2862,7 @@ impl<'gc> EditText<'gc> {
/// which is snapped to pixels using [`EditTextPixelSnapping`],
/// * the pixel-perfect position is really hard to achieve, currently it's best-effort only.
pub fn draw_text_box(
&self,
self,
context: &mut RenderContext<'_, 'gc>,
bounds: Rectangle<Twips>,
background_color: Option<Color>,
Expand Down
Loading