avm2: Implement `updateAfterEvent`
Implement `updateAfterEvent` for `MouseEvent`, `TimerEvent` and `TouchEvent`.
This commit is contained in:
parent
1a266bafeb
commit
3f7ea0b07f
|
@ -4,3 +4,5 @@ pub mod event;
|
|||
pub mod event_dispatcher;
|
||||
pub mod gesture_event;
|
||||
pub mod mouse_event;
|
||||
pub mod timer_event;
|
||||
pub mod touch_event;
|
||||
|
|
|
@ -76,10 +76,7 @@ package flash.events
|
|||
return this.formatToString("MouseEvent","type","bubbles","cancelable","eventPhase","localX","localY","stageX","stageY","relatedObject","ctrlKey","altKey","shiftKey","buttonDown","delta");
|
||||
}
|
||||
|
||||
public function updateAfterEvent():void {
|
||||
// TODO - determine when we should actually force a frame to be rendered.
|
||||
stub_method("flash.events.MouseEvent", "updateAfterEvent");
|
||||
}
|
||||
public native function updateAfterEvent():void;
|
||||
|
||||
public native function get stageX() : Number;
|
||||
public native function get stageY() : Number;
|
||||
|
|
|
@ -12,9 +12,6 @@ package flash.events {
|
|||
return new TimerEvent(this.type,this.bubbles,this.cancelable);
|
||||
}
|
||||
|
||||
public function updateAfterEvent():void {
|
||||
// TODO - determine when we should actually force a frame to be rendered.
|
||||
stub_method("flash.events.TimerEvent", "updateAfterEvent");
|
||||
}
|
||||
public native function updateAfterEvent():void;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,9 +101,7 @@ public class TouchEvent extends Event {
|
|||
}
|
||||
|
||||
// Instructs Flash Player or Adobe AIR to render after processing of this event completes, if the display list has been modified.
|
||||
public function updateAfterEvent(): void {
|
||||
stub_method("flash.events.TouchEvent", "updateAfterEvent");
|
||||
}
|
||||
public native function updateAfterEvent(): void;
|
||||
|
||||
public function get stageX(): Number {
|
||||
return this._stageX;
|
||||
|
|
|
@ -74,3 +74,12 @@ pub fn get_stage_y<'gc>(
|
|||
|
||||
Ok(Value::Undefined)
|
||||
}
|
||||
|
||||
pub fn update_after_event<'gc>(
|
||||
activation: &mut Activation<'_, 'gc>,
|
||||
_this: Option<Object<'gc>>,
|
||||
_args: &[Value<'gc>],
|
||||
) -> Result<Value<'gc>, Error<'gc>> {
|
||||
*activation.context.needs_render = true;
|
||||
Ok(Value::Undefined)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
use crate::avm2::activation::Activation;
|
||||
use crate::avm2::object::Object;
|
||||
use crate::avm2::value::Value;
|
||||
use crate::avm2::Error;
|
||||
|
||||
pub fn update_after_event<'gc>(
|
||||
activation: &mut Activation<'_, 'gc>,
|
||||
_this: Option<Object<'gc>>,
|
||||
_args: &[Value<'gc>],
|
||||
) -> Result<Value<'gc>, Error<'gc>> {
|
||||
*activation.context.needs_render = true;
|
||||
Ok(Value::Undefined)
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
use crate::avm2::activation::Activation;
|
||||
use crate::avm2::object::Object;
|
||||
use crate::avm2::value::Value;
|
||||
use crate::avm2::Error;
|
||||
|
||||
pub fn update_after_event<'gc>(
|
||||
activation: &mut Activation<'_, 'gc>,
|
||||
_this: Option<Object<'gc>>,
|
||||
_args: &[Value<'gc>],
|
||||
) -> Result<Value<'gc>, Error<'gc>> {
|
||||
*activation.context.needs_render = true;
|
||||
Ok(Value::Undefined)
|
||||
}
|
Loading…
Reference in New Issue