- コミット日時:
- 2010/03/21 18:04:34 (3 年前)
- ファイル:
-
- as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/LineCommand.as (更新) (2 diffs)
- as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/LineToCommand.as (更新) (3 diffs)
- as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/MoveToCommand.as (更新) (3 diffs)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/LineCommand.as
r3501 r3574 16 16 public function reset():void 17 17 { 18 m_compressedValue = 19 s_readCoordinate.x =20 s_readCoordinate.y =21 s_writeCoordinate.x =22 s_writeCoordinate.y= 0;18 m_compressedValue = 0; 19 s_readCoordinateX = 0; 20 s_readCoordinateY = 0; 21 s_writeCoordinateX = 0; 22 s_writeCoordinateY = 0; 23 23 } 24 24 … … 28 28 } 29 29 30 protected function get readCoordinate():Point 31 { 32 return s_readCoordinate; 33 } 34 35 protected function get writeCoordinate():Point 36 { 37 return s_writeCoordinate; 38 } 39 40 private static var s_readCoordinate:Point = new Point(); 41 private static var s_writeCoordinate:Point = new Point(); 30 protected var s_readCoordinateX:int; 31 protected var s_readCoordinateY:int; 32 protected var s_writeCoordinateX:int; 33 protected var s_writeCoordinateY:int; 42 34 protected var m_compressedValue:int; 43 35 } as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/LineToCommand.as
r3524 r3574 39 39 y = bytes.readShort(); 40 40 } 41 readCoordinate.x+= x;42 readCoordinate.y+= y;41 s_readCoordinateX += x; 42 s_readCoordinateY += y; 43 43 } 44 44 45 45 public function write(bytes:ByteArray, args:Object):void 46 46 { 47 var dx:int = args.x - writeCoordinate.x;48 var dy:int = args.y - writeCoordinate.y;47 var dx:int = args.x - s_writeCoordinateX; 48 var dy:int = args.y - s_writeCoordinateY; 49 49 if (dx >= -4 && dx <= 3 && dy >= -4 && dy <= 3) { 50 50 // dxもdyも3bitに収まる場合 … … 60 60 bytes.writeShort(dy); 61 61 } 62 writeCoordinate.x= args.x;63 writeCoordinate.y= args.y;62 s_writeCoordinateX = args.x; 63 s_writeCoordinateY = args.y; 64 64 } 65 65 … … 67 67 { 68 68 painter.lineTo( 69 readCoordinate.x || writeCoordinate.x,70 readCoordinate.y || writeCoordinate.y69 s_readCoordinateX || s_writeCoordinateX, 70 s_readCoordinateY || s_writeCoordinateY 71 71 ); 72 72 } as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/MoveToCommand.as
r3524 r3574 33 33 y = bytes.readShort(); 34 34 } 35 readCoordinate.x+= x;36 readCoordinate.y+= y;35 s_readCoordinateX += x; 36 s_readCoordinateY += y; 37 37 } 38 38 39 39 public function write(bytes:ByteArray, args:Object):void 40 40 { 41 var dx:int = args.x - writeCoordinate.x;42 var dy:int = args.y - writeCoordinate.y;41 var dx:int = args.x - s_writeCoordinateX; 42 var dy:int = args.y - s_writeCoordinateY; 43 43 if (dx >= -64 && dx <= 63 && dy >= -64 && dy <= 63) { 44 44 // dxもdyも7bitに収まる場合 … … 50 50 bytes.writeShort(dy); 51 51 } 52 writeCoordinate.x= args.x;53 writeCoordinate.y= args.y;52 s_writeCoordinateX = args.x; 53 s_writeCoordinateY = args.y; 54 54 } 55 55 … … 57 57 { 58 58 painter.moveTo( 59 readCoordinate.x || writeCoordinate.x,60 readCoordinate.y || writeCoordinate.y59 s_readCoordinateX || s_writeCoordinateX, 60 s_readCoordinateY || s_writeCoordinateY 61 61 ); 62 62 painter.startDrawingSession();

