Skip to content

Commit 85d8b2a

Browse files
kjaroshLord-McSweeney
authored andcommitted
core: Remove double pointers in EditText
EditText is a pointer already, no need to reference it.
1 parent eb3f657 commit 85d8b2a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

core/src/display_object/edit_text.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ impl<'gc> EditText<'gc> {
817817
Matrix::translate(-tx, -ty)
818818
}
819819

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

@@ -2035,7 +2035,7 @@ impl<'gc> EditText<'gc> {
20352035
self.on_changed(&mut activation);
20362036
}
20372037

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

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

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

20902090
/// Construct the text field's AVM1 representation.
2091-
fn construct_as_avm1_object(&self, context: &mut UpdateContext<'gc>, run_frame: bool) {
2091+
fn construct_as_avm1_object(self, context: &mut UpdateContext<'gc>, run_frame: bool) {
20922092
let mut text = self.0.write(context.gc());
20932093
if text.object.is_none() {
20942094
let object: Avm1Object<'gc> = Avm1StageObject::for_display_object(
20952095
&context.strings,
2096-
(*self).into(),
2096+
self.into(),
20972097
context.avm1.prototypes().text_field,
20982098
)
20992099
.into();
@@ -2102,10 +2102,10 @@ impl<'gc> EditText<'gc> {
21022102
}
21032103
drop(text);
21042104

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

21212121
/// Construct the text field's AVM2 representation.
21222122
fn construct_as_avm2_object(
2123-
&self,
2123+
self,
21242124
context: &mut UpdateContext<'gc>,
21252125
display_object: DisplayObject<'gc>,
21262126
) {
@@ -2777,7 +2777,7 @@ impl<'gc> EditText<'gc> {
27772777
/// the possible transforms are highly limited),
27782778
/// * the current implementation should be pixel-perfect (compared to FP).
27792779
pub fn draw_device_text_box(
2780-
&self,
2780+
self,
27812781
context: &mut RenderContext<'_, 'gc>,
27822782
bounds: Rectangle<Twips>,
27832783
background_color: Option<Color>,
@@ -2862,7 +2862,7 @@ impl<'gc> EditText<'gc> {
28622862
/// which is snapped to pixels using [`EditTextPixelSnapping`],
28632863
/// * the pixel-perfect position is really hard to achieve, currently it's best-effort only.
28642864
pub fn draw_text_box(
2865-
&self,
2865+
self,
28662866
context: &mut RenderContext<'_, 'gc>,
28672867
bounds: Rectangle<Twips>,
28682868
background_color: Option<Color>,

0 commit comments

Comments
 (0)