チェンジセット 1103: as3/gunyarapaint
- コミット日時:
- 2008/08/27 18:16:52 (5 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/gunyarapaint/trunk/gunyarapaint/.actionScriptProperties
r1090 r1103 6 6 <libraryPathEntry kind="4" path=""/> 7 7 <libraryPathEntry kind="1" linkType="1" path="libs"/> 8 <libraryPathEntry kind="3" linkType="1" path=" /nicopedia/bin/nicopedia.swc" useDefaultLinkType="false"/>8 <libraryPathEntry kind="3" linkType="1" path="C:/mydoc/gp-svn/nicopedia/bin/nicopedia.swc" useDefaultLinkType="false"/> 9 9 </libraryPath> 10 10 <sourceAttachmentPath/> as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Canvas.as
r1098 r1103 1 1 package gunyarapaint 2 2 { 3 import com.adobe.images.PNGEncoder;4 5 3 import flash.display.Bitmap; 6 4 import flash.display.BitmapData; … … 349 347 private function mouseUp(evt:MouseEvent):void { 350 348 if (!isDrawnLine) { 351 lineShape.graphics.drawRect(currentPoint.x, currentPoint.y, 1, 1); 349 // ドットを打つ。そのときのペンタイプで。 350 // lineShape.graphics.drawRect(currentPoint.x, currentPoint.y, 1, 1); 352 351 } 353 352 drawShapeOnBitmap(); … … 447 446 playLogSpeed = speed; 448 447 } 449 448 449 public function drawRect(x:uint, y:uint, width:uint, height:uint):void { 450 lineShape.graphics.drawRect(x, y, width, height); 451 logWrite(['drawRect', x, y, width, height]); 452 //currentPoint.x = x; 453 //currentPoint.y = y; 454 } 455 450 456 private function playLogNext():void { 451 457 for (var i:uint = 0; i < playLogSpeed; i++) { 452 458 var a:Array; 453 459 var isBreak:Boolean = false; 460 var preAction:uint = Logger.ACTION_NONE; // for avoid first version bug ●-◆ 454 461 if ((a = log.read())) { 455 462 var action:uint = a[0]; 456 463 switch (action) { 457 464 case Logger.ACTION_MOVETO: 465 if (preAction == Logger.ACTION_MOVETO) { 466 // avoid bug 467 drawRect(currentPoint.x, currentPoint.y, 1, 1); 468 } 458 469 moveTo(a[1], a[2]); 459 470 break; … … 461 472 lineTo(a[1], a[2]); 462 473 break; 474 case Logger.ACTION_DRAWRECT: 475 drawRect(a[1], a[2], a[3], a[4]); 476 break; 463 477 case Logger.ACTION_LINESTYLE: 464 478 switch (a[1]) { … … 491 505 case Logger.ACTION_DRAW_SHAPE_ON_BITMAP: 492 506 drawShapeOnBitmap(); 493 isBreak = true; 507 // 高速化のためコメントアウト 508 // isBreak = true; 494 509 break; 495 510 case Logger.ACTION_UNDO: … … 506 521 break; 507 522 } 523 preAction = action; 508 524 } else { 509 525 flash.utils.clearInterval(playLogIntervalId); as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Logger.as
r1099 r1103 52 52 53 53 // ACTIONは6bit長 0x3fまで 54 public static const ACTION_NONE:uint = 0; 54 55 public static const ACTION_MOVETO:uint = 1; 55 56 public static const ACTION_LINETO:uint = 2; … … 59 60 public static const ACTION_REDO:uint = 6; 60 61 public static const ACTION_ROLLING:uint = 7; 62 public static const ACTION_DRAWRECT:uint = 7; 61 63 62 64 // LINESTYLE … … 132 134 } 133 135 break; 136 case 'drawRect': 137 // FIXME: 圧縮! 138 x = info[1]; 139 y = info[2]; 140 width = info[3]; 141 height = info[4]; 142 break; 134 143 case 'drawShapeOnBitmap': 135 144 writeByte(ACTION_DRAW_SHAPE_ON_BITMAP); … … 188 197 var short:uint; 189 198 var obj:Object; 199 190 200 try { 191 201 byte = readByte();

