зеркало из https://github.com/mozilla/shumway.git
add getBounds test from Tobias
This commit is contained in:
Родитель
ee3aeda945
Коммит
b903d52769
Двоичные данные
test/swfs/add.swf
Двоичные данные
test/swfs/add.swf
Двоичный файл не отображается.
Двоичные данные
test/swfs/bitmapbuttons.swf
Двоичные данные
test/swfs/bitmapbuttons.swf
Двоичный файл не отображается.
|
@ -21,6 +21,7 @@ import flash.display.Stage;
|
|||
import flash.display.StageAlign;
|
||||
import flash.display.StageScaleMode;
|
||||
import flash.system.Capabilities;
|
||||
import flash.accessibility.Accessibility;
|
||||
import flash.accessibility.AccessibilityProperties;
|
||||
import flash.events.*;
|
||||
import flash.filters.*;
|
||||
|
@ -51,7 +52,6 @@ class CustomDisplayObject extends Sprite {
|
|||
}
|
||||
|
||||
private function addedHandler(event:Event):void {
|
||||
trace("addedHandler: " + event);
|
||||
stage.scaleMode = StageScaleMode.NO_SCALE;
|
||||
stage.align = StageAlign.TOP_LEFT;
|
||||
stage.addEventListener("resize", resizeHandler);
|
||||
|
@ -60,7 +60,6 @@ class CustomDisplayObject extends Sprite {
|
|||
private var frameCount = 0;
|
||||
|
||||
private function enterFrameHandler(event:Event):void {
|
||||
trace("enterFrameHandler: " + event);
|
||||
var target = event.target;
|
||||
switch (frameCount) {
|
||||
case 0:
|
||||
|
@ -136,7 +135,6 @@ class CustomDisplayObject extends Sprite {
|
|||
})();
|
||||
break;
|
||||
case 7:
|
||||
trace("frame 7");
|
||||
(function () {
|
||||
var skewMatrix:Matrix = new Matrix();
|
||||
skewMatrix.c = 0.25;
|
||||
|
@ -148,14 +146,42 @@ class CustomDisplayObject extends Sprite {
|
|||
target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOffset, 0, bOffset, 0);
|
||||
})();
|
||||
break;
|
||||
case 8:
|
||||
(function () {
|
||||
var container = new Sprite;
|
||||
container.x = 100;
|
||||
container.y = 100;
|
||||
container.rotation = -42;
|
||||
var contents = new Shape;
|
||||
contents.graphics.drawCircle(0, 0, 100);
|
||||
contents.x = 50;
|
||||
contents.y = 50;
|
||||
contents.scaleX = -1;
|
||||
// FIXME not compatible with Flash
|
||||
// traceRoundedRect(contents.getBounds(container));
|
||||
container.addChild(contents);
|
||||
traceRoundedRect(contents.getBounds(container));
|
||||
traceRoundedRect(contents.getBounds(target));
|
||||
function traceRoundedRect(rect) {
|
||||
trace('(' +
|
||||
'x=' + ~~rect.x + ', ' +
|
||||
'y=' + ~~rect.y + ', ' +
|
||||
'width=' + ~~rect.width + ', ' +
|
||||
'height=' + ~~rect.height +
|
||||
')');
|
||||
}
|
||||
})();
|
||||
// Expected output:
|
||||
// (x=-144, y=-211, width=282, height=282)
|
||||
// (x=-50, y=-50, width=200, height=200)
|
||||
// (x=29, y=-37, width=282, height=282)
|
||||
break;
|
||||
default:
|
||||
removeEventListener("enterFrame", enterFrameHandler);
|
||||
}
|
||||
frameCount++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private var distance:Number = 0;
|
||||
|
||||
public function GradientGlowFilterExample() {
|
||||
|
@ -170,8 +196,6 @@ class CustomDisplayObject extends Sprite {
|
|||
return new GradientGlowFilter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function removedHandler(event:Event):void {
|
||||
trace("removedHandler: " + event);
|
||||
stage.removeEventListener("resize", resizeHandler);
|
||||
|
|
Двоичные данные
test/swfs/flash_display_DisplayObject.swf
Двоичные данные
test/swfs/flash_display_DisplayObject.swf
Двоичный файл не отображается.
|
@ -1,22 +1,13 @@
|
|||
addedHandler: [Event type="added" bubbles=false cancelable=false eventPhase=2]
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
get x=100
|
||||
get y=100
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
get height=80
|
||||
get width=80
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
get alpha=0.3
|
||||
Capabilities.hasAccessibility=false
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
get accessibilityProperties=Greeting
|
||||
set filters
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
get filters: filters.length=2
|
||||
set visible = false
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
get visible: false
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
frame 7
|
||||
enterFrameHandler: [Event type="enterFrame" bubbles=false cancelable=false eventPhase=2]
|
||||
(x=-50, y=-50, width=200, height=200)
|
||||
(x=29, y=-37, width=282, height=282)
|
||||
|
|
Загрузка…
Ссылка в новой задаче