Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: LayoutTests/imported/web-platform-tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx

Issue 1157103007: update-w3c-deps import using blink b712b6ce0eb599d90d890aa609f596c7852fb824 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Skip swfsoures Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/imported/web-platform-tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx
diff --git a/LayoutTests/imported/web-platform-tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx b/LayoutTests/imported/web-platform-tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx
deleted file mode 100644
index 25fc51ef0d2b5f2d3cdd02b280e43ff94801ec84..0000000000000000000000000000000000000000
--- a/LayoutTests/imported/web-platform-tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx
+++ /dev/null
@@ -1,133 +0,0 @@
-import Std;
-import flash.Lib;
-import flash.events.MouseEvent;
-
-class DragNDrop
-{
- static var s_box_draggable:Box;
- static var s_box_target:Box;
- static var s_dragging:Bool = false;
-
- private static function main()
- {
- /* Blue box (target). */
- s_box_target = new Box(0x0000ff, 100, 100, 150, 150);
- /* Orange box (draggable). */
- s_box_draggable = new Box(0xffa500, 25, 25, 50, 50);
-
- flash.Lib.current.stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
- flash.Lib.current.stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);
- flash.Lib.current.stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
- }
-
- static function OnMouseDown(event:MouseEvent):Void
- {
- if (s_box_draggable.IsHit(event.stageX, event.stageY))
- s_dragging = true;
- }
-
- static function OnMouseUp(event:MouseEvent):Void
- {
- s_dragging = false;
-
- /* Check if passed. */
- if (s_box_draggable.IsWithin(s_box_target))
- {
- s_box_draggable.Hide();
- s_box_target.SetColor(0xffee00);
- }
- }
-
- static function OnMouseMove(event:MouseEvent):Void
- {
- if (s_dragging)
- {
- ClearCanvas();
- s_box_target.Redraw();
- s_box_draggable.Move(event.stageX, event.stageY);
- }
- }
-
- static function ClearCanvas():Void
- {
- var mc:flash.display.MovieClip = flash.Lib.current;
- mc.graphics.beginFill(0xffffff);
- mc.graphics.drawRect(0, 0, flash.Lib.current.stage.width, flash.Lib.current.stage.height);
- mc.graphics.endFill();
- }
-}
-
-class Box
-{
- var m_mc:flash.display.MovieClip;
- var m_color:Int;
- var m_rel_x:Float;
- var m_rel_y:Float;
- var m_x:Float;
- var m_y:Float;
- var m_width:Int;
- var m_height:Int;
-
- public function new(color:Int, x:Int, y:Int, width:Int, height:Int)
- {
- m_mc = flash.Lib.current;
- m_color = color;
- m_x = x;
- m_y = y;
- m_width = width;
- m_height = height;
-
- Redraw();
- }
-
- public function IsHit(x:Float, y:Float):Bool
- {
- if ((x >= m_x && x <= m_x + m_width) && (y >= m_y && y <= m_y + m_height))
- {
- m_rel_x = x - m_x;
- m_rel_y = y - m_y;
- return true;
- }
-
- return false;
- }
-
- public function IsWithin(other:Box):Bool
- {
- return m_x >= other.m_x && m_x + m_width <= other.m_x + other.m_width
- && m_y >= other.m_y && m_y + m_height <= other.m_y + other.m_height;
- }
-
- public function Hide():Void
- {
- m_width = 0;
- m_height = 0;
- }
-
- public function SetColor(color:Int):Void
- {
- m_color = color;
- Redraw();
- }
-
- public function Move(x:Float, y:Float):Void
- {
- /* Accounting for click offset. */
- m_x = x - m_rel_x;
- m_y = y - m_rel_y;
- Draw(Std.int(m_x), Std.int(m_y), m_width, m_height);
- }
-
- public function Redraw():Void
- {
- Draw(Std.int(m_x), Std.int(m_y), m_width, m_height);
- }
-
- private function Draw(x:Int, y:Int, width:Int, height:Int)
- {
- /* Draw moved rect. */
- m_mc.graphics.beginFill(m_color);
- m_mc.graphics.drawRect(x, y, width, height);
- m_mc.graphics.endFill();
- }
-}

Powered by Google App Engine
This is Rietveld 408576698