チェンジセット 1094

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

r45@poppop (orig r44): tasuku | 2008-03-28 00:32:51 +0900
いろいろなおした。

ファイル:

凡例:

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

    r1092 r1094  
    3030  comm = new Com(); 
    3131  comm.addEventListener('completeGetData', commCompleteHandler); 
    32   if (parameters['postUrl'] && parameters['cookie'] && parameters['magic']) { 
     32   
     33  if (parameters['postUrl'] && parameters['cookie'] && parameters['magic'] && parameters['redirectUrl']) { 
    3334    comm.setPostEnv(parameters['postUrl'], parameters['cookie'], parameters['magic']); 
    3435    postOekakiButton.enabled = true; 
    35   } 
    36   if (parameters['oekakiId']) { 
    37     oekakiId = uint(parameters['oekakiId']); 
    38   } 
    39   if (parameters['redirectUrl']) { 
    4036    redirectUrl = parameters['redirectUrl']; 
    4137  } 
     
    5248    //return; 
    5349  } 
    54   if (parameters['baseImgUrl']) { 
     50  if (parameters['oekakiId'] && parameters['baseImgUrl']) { 
     51    oekakiId = uint(parameters['oekakiId']); 
    5552    var url:String = parameters['baseImgUrl']; 
    5653    comm.loadUrl(url); 
     
    6966      } 
    7067    } else { 
    71       canvasWidth = 700; canvasHeight = 30; 
     68      canvasWidth = 600; canvasHeight = 500; 
    7269      //return; 
    7370    } 
     
    131128  gpCanvas.rotation = 0; 
    132129 
    133   this.width = canvasWidth * 1.15 + 20; 
    134   if (this.width < 630) { 
    135     this.width = 630; 
    136   } 
     130  this.width = canvasWidth + 20; 
    137131  this.height = canvasHeight + canvas.y + 10; 
    138 //  canvas.x = (this.width - canvas.width) / 2; 
     132   
    139133  canvas.x = 10; 
    140134  basex = canvas.x; 
    141135  basey = canvas.y; 
    142   baseWidth = this.width; 
    143   baseHeight = this.height; 
    144136  changeGunyaraPaintRect(); 
     137 
     138  toolCanvas.x = (this.width - toolCanvas.width) / 2; 
    145139} 
    146140 
     
    148142  if (onPost) { 
    149143    onPost = false; 
    150     if (comm.getHttpStatus() == 400 || comm.getError()) { 
     144    if (comm.getHttpStatus() == 202 || comm.getError()) { 
    151145      // error 
    152146      Alert.show(comm.getStringData(), ALERT_TITLE); 
     
    186180  if (deg >= 0) { 
    187181    if (deg <= 90) { 
    188       canvas.x = basex + Math.sin(rad) * canvasHeight
     182      canvas.x = Math.sin(rad) * canvasHeight + 10
    189183      canvas.y = basey; 
    190     } else { 
    191       // FIXME: implement 
     184      this.width = canvasHeight * Math.sin(rad) + 
     185                    canvasWidth * Math.cos(rad) + 20; 
     186      this.height = canvasHeight * Math.cos(rad) + 
     187                     canvasWidth * Math.abs(Math.sin(rad)) + basey + 10; 
     188    } else { 
     189      canvas.x = canvasHeight * Math.sin(rad) - Math.cos(rad) * canvasWidth + 10; 
     190      canvas.y = basey - Math.cos(rad) * canvasHeight; 
     191      this.width = canvasHeight * Math.sin(rad) - Math.cos(rad) * canvasWidth + 20; 
     192      this.height = -canvasHeight * Math.cos(rad) + 
     193                     canvasWidth * Math.sin(rad) + basey + 10; 
    192194    } 
    193195  } else { 
     
    195197      canvas.x = basex; 
    196198      canvas.y = basey - Math.sin(rad) * canvasWidth; 
    197     } else { 
    198       // FIXME: implement 
    199     } 
    200   }  
    201   this.height = canvasHeight * (Math.cos(rad) - 1) + 
    202                  canvasWidth * Math.abs(Math.sin(rad)) + baseHeight; 
     199      this.width = canvasHeight * Math.sin(Math.abs(rad)) + 
     200                    canvasWidth * Math.cos(rad) + 20; 
     201      this.height = canvasHeight * Math.cos(rad) + 
     202                     canvasWidth * Math.abs(Math.sin(rad)) + basey + 10; 
     203    } else { 
     204      canvas.x = basex - Math.cos(rad) * canvasWidth; 
     205      canvas.y = basey - Math.sin(rad) * canvasWidth - Math.cos(rad) * canvasHeight + 40; 
     206      this.width = basex - Math.cos(rad) * canvasWidth - Math.sin(rad) * canvasHeight; 
     207      this.height = basey - Math.sin(rad) * canvasWidth - Math.cos(rad) * canvasHeight + 40; 
     208    } 
     209  } 
    203210  changeGunyaraPaintRect(); 
    204211} 
    205212private function changeGunyaraPaintRect():void { 
    206   toolCanvas.x = (this.width - toolCanvas.width) / 2; 
    207213  // 外部のスクリプト呼び出し。主に回転時のサイズ変更 
     214  if (this.width < (toolCanvas.width + 4)) { 
     215    this.width = toolCanvas.width + 4; 
     216  } 
    208217  if (ExternalInterface.available) { 
    209218    try { 
     
    266275  if (messageTextArea.text == '') { 
    267276    Alert.show('書き込みが空です。絵のタイトルなどの情報を書き込んでください。', ALERT_TITLE); 
    268     return;       
    269   } 
    270   /* 
    271   if (mml.text == '') { 
    272     Alert.show('絵が空です。絵を描いてしてください。', ALERT_TITLE); 
    273277    return; 
    274278  } 
    275   */ 
    276279  this.enabled = false; 
    277280  onPost = true; 
  • as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint.mxml

    r1092 r1094  
    22<mx:Application 
    33  xmlns:mx="http://www.adobe.com/2006/mxml" 
    4   layout="absolute" width="630" height="484" 
     4  layout="absolute" width="640" height="484" 
    55  creationComplete="init()" 
    66  borderStyle="solid" cornerRadius="0" borderColor="#333333" 
     
    99  <mx:Script source="gunyarapaint.as"> 
    1010  </mx:Script> 
    11   <mx:Canvas id="toolCanvas" x="0" y="0" width="620"> 
     11  <mx:Canvas id="toolCanvas" x="0" y="0" width="630"> 
    1212    <mx:Label x="28" y="7" text="名前"/> 
    1313    <mx:TextInput id="fromTextInput" x="55" y="3" maxChars="32" fontSize="14"/> 
     
    1717    </mx:TextArea> 
    1818    <mx:Label x="10" y="99" text="ペンの太さ"/> 
    19     <mx:NumericStepper id="thicknessStepper" x="69" y="97" value="3"  minimum="0" maximum="30" stepSize="1"/> 
     19    <mx:NumericStepper id="thicknessStepper" x="69" y="97" value="3"  minimum="1" maximum="30" stepSize="1"/> 
    2020    <mx:Label x="136" y="99" text="ペンの色"/> 
    2121    <mx:ColorPicker id="colorPicker" x="184" y="97"/> 
     
    2626    </mx:ComboBox> 
    2727    <mx:Label x="10" y="125" text="キャンバスの角度"/> 
    28     <mx:HSlider id="canvasRotate" x="86" y="124" width="152" minimum="-90" maximum="90" snapInterval="5" value="0" /> 
     28    <mx:HSlider id="canvasRotate" x="86" y="124" width="152" minimum="-180" maximum="180" snapInterval="5" value="0" /> 
    2929    <mx:Button id="undoButton" x="250" y="123" label="アンドゥ" enabled="false" paddingLeft="3" paddingRight="3"/> 
    3030    <mx:Button id="redoButton" x="331" y="123" label="リドゥ" enabled="false" paddingLeft="3" paddingRight="3"/> 
     
    3232    <mx:NumericStepper id="additionalNumberStepper" x="434" y="123" value="4" minimum="2" maximum="10" stepSize="1"/> 
    3333    <mx:CheckBox id="additionalBoxCheckBox" x="500" y="123" label="縦横"/> 
    34     <mx:CheckBox id="additionalSkewCheckBox" x="553" y="123" label="斜め"/>     
    35     <mx:Button id="postOekakiButton" x="510" y="7" label="お絵カキコする!" fillAlphas="[1.0, 1.0, 1.0, 1.0]" fillColors="[#FFFFFF, #FF9999, #FFFFFF, #FFCCCC]"/> 
     34    <mx:CheckBox id="additionalSkewCheckBox" x="553" y="123" label="斜め"/> 
     35    <mx:Button id="postOekakiButton" x="510" y="7" label="お絵カキコする!" fillAlphas="[1.0, 1.0, 1.0, 1.0]" fillColors="[#FFFFFF, #FF9999, #FFFFFF, #FFCCCC]" enabled="false"/> 
    3636  </mx:Canvas> 
    37   <mx:Canvas id="canvas" width="400" height="300" y="172"></mx:Canvas> 
     37  <mx:Canvas id="canvas" width="400" height="300" x="10" y="172"></mx:Canvas> 
    3838</mx:Application> 
  • as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Canvas.as

    r1093 r1094  
    4242    private var canWidth:uint, canHeight:uint; 
    4343 
     44        private var preLineThickness:uint; 
     45        private var preLineColor:uint; 
     46        private var preLineAlpha:Number; 
     47        private var preLineBlendMode:String; 
     48        private var preLineScaleMode:String; 
     49        private var preLineCapsStyle:String; 
     50        private var preLineJointStyle:String; 
     51        private var preLineMiterLimit:Number; 
     52 
    4453        private var lineThickness:uint; 
    4554        private var lineColor:uint; 
     
    159168          } 
    160169          this.lineThickness = t; 
    161           logWrite(['lineStyle', Logger.LINESTYLE_THICKNESS, t]) 
    162170        } 
    163171    public function setLineColor(color:uint):void { 
    164172      this.lineColor = color; 
    165           logWrite(['lineStyle', Logger.LINESTYLE_COLOR, color]) 
    166173    } 
    167174        public function setLineAlpha(alpha:Number):void { 
    168175          this.lineAlpha = alpha; 
    169           logWrite(['lineStyle', Logger.LINESTYLE_ALPHA, alpha]) 
    170176        } 
    171177        public function setLineBlendMode(blend:String):void { 
    172178          this.lineBlendMode = blend; 
    173           logWrite(['lineStyle', Logger.LINESTYLE_BLEND_MODE, blend]) 
    174179        } 
    175180        public function setLineScaleMode(mode:String):void { 
    176181          this.lineScaleMode = mode; 
    177           logWrite(['lineStyle', Logger.LINESTYLE_SCALE_MODE, mode]) 
    178182        } 
    179183        public function setLineCapsStyle(caps:String):void { 
    180184          this.lineCapsStyle = caps; 
    181           logWrite(['lineStyle', Logger.LINESTYLE_CAPS, caps]) 
    182185        } 
    183186        public function setLineJointStyle(joints:String):void { 
    184187          this.lineJointStyle = joints; 
    185           logWrite(['lineStyle', Logger.LINESTYLE_JOINTS, joints]) 
    186188        } 
    187189        public function setLineMiterLimit(miterLimit:Number):void { 
    188190          this.lineMiterLimit = miterLimit; 
    189           logWrite(['lineStyle', Logger.LINESTYLE_MITER_LIMIT, miterLimit]) 
    190191        } 
    191192        private function setLineStyle():void { 
     
    197198                                   lineCapsStyle, 
    198199                                   lineJointStyle, 
    199                                    lineMiterLimit);       
     200                                   lineMiterLimit);     
    200201      lineShape.blendMode = lineBlendMode; 
     202 
     203      if (preLineThickness != lineThickness) { 
     204        logWrite(['lineStyle', Logger.LINESTYLE_THICKNESS, lineThickness]); 
     205      } 
     206      if (preLineColor != lineColor) { 
     207        logWrite(['lineStyle', Logger.LINESTYLE_COLOR, lineColor]); 
     208      } 
     209      if (preLineAlpha != lineAlpha) { 
     210        logWrite(['lineStyle', Logger.LINESTYLE_ALPHA, lineAlpha]); 
     211      } 
     212      if (preLineBlendMode != lineBlendMode) { 
     213        logWrite(['lineStyle', Logger.LINESTYLE_BLEND_MODE, lineBlendMode]); 
     214      } 
     215      if (preLineScaleMode != lineScaleMode) { 
     216        logWrite(['lineStyle', Logger.LINESTYLE_SCALE_MODE, lineScaleMode]); 
     217      } 
     218      if (preLineCapsStyle != lineCapsStyle) { 
     219        logWrite(['lineStyle', Logger.LINESTYLE_CAPS, lineCapsStyle]); 
     220      } 
     221      if (preLineJointStyle != lineJointStyle) { 
     222        logWrite(['lineStyle', Logger.LINESTYLE_JOINTS, lineJointStyle]); 
     223      } 
     224      if (preLineMiterLimit != lineMiterLimit) { 
     225        logWrite(['lineStyle', Logger.LINESTYLE_MITER_LIMIT, lineMiterLimit]); 
     226      } 
     227       
     228      preLineThickness = lineThickness; 
     229      preLineColor = lineColor; 
     230      preLineAlpha = lineAlpha; 
     231      preLineBlendMode = lineBlendMode; 
     232      preLineScaleMode = lineScaleMode; 
     233      preLineCapsStyle = lineCapsStyle; 
     234      preLineJointStyle = lineJointStyle; 
     235      preLineMiterLimit = lineMiterLimit; 
     236 
    201237        } 
    202238        public function getLineColor():uint { 
  • as3/gunyarapaint/trunk/picokakiko/src/picokakiko.as

    r1090 r1094  
    4949  if (onPost) { 
    5050    onPost = false; 
    51     if (comm.getHttpStatus() == 400 || comm.getError()) { 
     51    if (comm.getHttpStatus() == 202 || comm.getError()) { 
    5252      // error 
    5353      Alert.show(comm.getStringData(), ALERT_TITLE);