チェンジセット 1103: as3/gunyarapaint

差分発生行の前後
無視リスト:
コミット日時:
2008/08/27 18:16:52 (5 年前)
コミッタ:
tasuku
ログメッセージ:

r54@poppop (orig r53): tasuku | 2008-05-26 12:09:58 +0900
途中。。。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/gunyarapaint/trunk/gunyarapaint/.actionScriptProperties

    r1090 r1103  
    66<libraryPathEntry kind="4" path=""/> 
    77<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"/> 
    99</libraryPath> 
    1010<sourceAttachmentPath/> 
  • as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Canvas.as

    r1098 r1103  
    11package gunyarapaint 
    22{ 
    3   import com.adobe.images.PNGEncoder; 
    4    
    53  import flash.display.Bitmap; 
    64  import flash.display.BitmapData; 
     
    349347    private function mouseUp(evt:MouseEvent):void { 
    350348      if (!isDrawnLine) { 
    351         lineShape.graphics.drawRect(currentPoint.x, currentPoint.y, 1, 1); 
     349        // ドットを打つ。そのときのペンタイプで。 
     350        // lineShape.graphics.drawRect(currentPoint.x, currentPoint.y, 1, 1); 
    352351      } 
    353352      drawShapeOnBitmap(); 
     
    447446          playLogSpeed = speed; 
    448447        } 
    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 
    450456        private function playLogNext():void { 
    451457          for (var i:uint = 0; i < playLogSpeed; i++) { 
    452458        var a:Array; 
    453459        var isBreak:Boolean = false; 
     460        var preAction:uint = Logger.ACTION_NONE; // for avoid first version bug ●-◆ 
    454461        if ((a = log.read())) { 
    455462          var action:uint = a[0]; 
    456463          switch (action) { 
    457464          case Logger.ACTION_MOVETO: 
     465            if (preAction == Logger.ACTION_MOVETO) { 
     466              // avoid bug 
     467              drawRect(currentPoint.x, currentPoint.y, 1, 1); 
     468            } 
    458469            moveTo(a[1], a[2]); 
    459470            break; 
     
    461472            lineTo(a[1], a[2]); 
    462473            break; 
     474          case Logger.ACTION_DRAWRECT: 
     475                drawRect(a[1], a[2], a[3], a[4]); 
     476                break; 
    463477          case Logger.ACTION_LINESTYLE: 
    464478            switch (a[1]) { 
     
    491505          case Logger.ACTION_DRAW_SHAPE_ON_BITMAP: 
    492506            drawShapeOnBitmap(); 
    493             isBreak = true; 
     507            // 高速化のためコメントアウト 
     508            // isBreak = true; 
    494509            break; 
    495510          case Logger.ACTION_UNDO: 
     
    506521            break; 
    507522          } 
     523          preAction = action; 
    508524        } else { 
    509525          flash.utils.clearInterval(playLogIntervalId); 
  • as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Logger.as

    r1099 r1103  
    5252 
    5353    // ACTIONは6bit長 0x3fまで 
     54    public static const ACTION_NONE:uint = 0; 
    5455    public static const ACTION_MOVETO:uint = 1; 
    5556    public static const ACTION_LINETO:uint = 2; 
     
    5960    public static const ACTION_REDO:uint = 6; 
    6061    public static const ACTION_ROLLING:uint = 7; 
     62    public static const ACTION_DRAWRECT:uint = 7; 
    6163 
    6264    // LINESTYLE 
     
    132134        } 
    133135        break; 
     136      case 'drawRect': 
     137        // FIXME: 圧縮! 
     138        x = info[1]; 
     139        y = info[2]; 
     140        width = info[3]; 
     141        height = info[4]; 
     142        break; 
    134143      case 'drawShapeOnBitmap': 
    135144        writeByte(ACTION_DRAW_SHAPE_ON_BITMAP); 
     
    188197      var short:uint; 
    189198      var obj:Object; 
     199       
    190200      try { 
    191201        byte = readByte();