チェンジセット 1094
- コミット日時:
- 2008/08/27 18:16:14 (5 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint.as
r1092 r1094 30 30 comm = new Com(); 31 31 comm.addEventListener('completeGetData', commCompleteHandler); 32 if (parameters['postUrl'] && parameters['cookie'] && parameters['magic']) { 32 33 if (parameters['postUrl'] && parameters['cookie'] && parameters['magic'] && parameters['redirectUrl']) { 33 34 comm.setPostEnv(parameters['postUrl'], parameters['cookie'], parameters['magic']); 34 35 postOekakiButton.enabled = true; 35 }36 if (parameters['oekakiId']) {37 oekakiId = uint(parameters['oekakiId']);38 }39 if (parameters['redirectUrl']) {40 36 redirectUrl = parameters['redirectUrl']; 41 37 } … … 52 48 //return; 53 49 } 54 if (parameters['baseImgUrl']) { 50 if (parameters['oekakiId'] && parameters['baseImgUrl']) { 51 oekakiId = uint(parameters['oekakiId']); 55 52 var url:String = parameters['baseImgUrl']; 56 53 comm.loadUrl(url); … … 69 66 } 70 67 } else { 71 canvasWidth = 700; canvasHeight = 30;68 canvasWidth = 600; canvasHeight = 500; 72 69 //return; 73 70 } … … 131 128 gpCanvas.rotation = 0; 132 129 133 this.width = canvasWidth * 1.15 + 20; 134 if (this.width < 630) { 135 this.width = 630; 136 } 130 this.width = canvasWidth + 20; 137 131 this.height = canvasHeight + canvas.y + 10; 138 // canvas.x = (this.width - canvas.width) / 2; 132 139 133 canvas.x = 10; 140 134 basex = canvas.x; 141 135 basey = canvas.y; 142 baseWidth = this.width;143 baseHeight = this.height;144 136 changeGunyaraPaintRect(); 137 138 toolCanvas.x = (this.width - toolCanvas.width) / 2; 145 139 } 146 140 … … 148 142 if (onPost) { 149 143 onPost = false; 150 if (comm.getHttpStatus() == 400|| comm.getError()) {144 if (comm.getHttpStatus() == 202 || comm.getError()) { 151 145 // error 152 146 Alert.show(comm.getStringData(), ALERT_TITLE); … … 186 180 if (deg >= 0) { 187 181 if (deg <= 90) { 188 canvas.x = basex + Math.sin(rad) * canvasHeight;182 canvas.x = Math.sin(rad) * canvasHeight + 10; 189 183 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; 192 194 } 193 195 } else { … … 195 197 canvas.x = basex; 196 198 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 } 203 210 changeGunyaraPaintRect(); 204 211 } 205 212 private function changeGunyaraPaintRect():void { 206 toolCanvas.x = (this.width - toolCanvas.width) / 2;207 213 // 外部のスクリプト呼び出し。主に回転時のサイズ変更 214 if (this.width < (toolCanvas.width + 4)) { 215 this.width = toolCanvas.width + 4; 216 } 208 217 if (ExternalInterface.available) { 209 218 try { … … 266 275 if (messageTextArea.text == '') { 267 276 Alert.show('書き込みが空です。絵のタイトルなどの情報を書き込んでください。', ALERT_TITLE); 268 return;269 }270 /*271 if (mml.text == '') {272 Alert.show('絵が空です。絵を描いてしてください。', ALERT_TITLE);273 277 return; 274 278 } 275 */276 279 this.enabled = false; 277 280 onPost = true; as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint.mxml
r1092 r1094 2 2 <mx:Application 3 3 xmlns:mx="http://www.adobe.com/2006/mxml" 4 layout="absolute" width="6 30" height="484"4 layout="absolute" width="640" height="484" 5 5 creationComplete="init()" 6 6 borderStyle="solid" cornerRadius="0" borderColor="#333333" … … 9 9 <mx:Script source="gunyarapaint.as"> 10 10 </mx:Script> 11 <mx:Canvas id="toolCanvas" x="0" y="0" width="6 20">11 <mx:Canvas id="toolCanvas" x="0" y="0" width="630"> 12 12 <mx:Label x="28" y="7" text="名前"/> 13 13 <mx:TextInput id="fromTextInput" x="55" y="3" maxChars="32" fontSize="14"/> … … 17 17 </mx:TextArea> 18 18 <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"/> 20 20 <mx:Label x="136" y="99" text="ペンの色"/> 21 21 <mx:ColorPicker id="colorPicker" x="184" y="97"/> … … 26 26 </mx:ComboBox> 27 27 <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" /> 29 29 <mx:Button id="undoButton" x="250" y="123" label="アンドゥ" enabled="false" paddingLeft="3" paddingRight="3"/> 30 30 <mx:Button id="redoButton" x="331" y="123" label="リドゥ" enabled="false" paddingLeft="3" paddingRight="3"/> … … 32 32 <mx:NumericStepper id="additionalNumberStepper" x="434" y="123" value="4" minimum="2" maximum="10" stepSize="1"/> 33 33 <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"/> 36 36 </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> 38 38 </mx:Application> as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Canvas.as
r1093 r1094 42 42 private var canWidth:uint, canHeight:uint; 43 43 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 44 53 private var lineThickness:uint; 45 54 private var lineColor:uint; … … 159 168 } 160 169 this.lineThickness = t; 161 logWrite(['lineStyle', Logger.LINESTYLE_THICKNESS, t])162 170 } 163 171 public function setLineColor(color:uint):void { 164 172 this.lineColor = color; 165 logWrite(['lineStyle', Logger.LINESTYLE_COLOR, color])166 173 } 167 174 public function setLineAlpha(alpha:Number):void { 168 175 this.lineAlpha = alpha; 169 logWrite(['lineStyle', Logger.LINESTYLE_ALPHA, alpha])170 176 } 171 177 public function setLineBlendMode(blend:String):void { 172 178 this.lineBlendMode = blend; 173 logWrite(['lineStyle', Logger.LINESTYLE_BLEND_MODE, blend])174 179 } 175 180 public function setLineScaleMode(mode:String):void { 176 181 this.lineScaleMode = mode; 177 logWrite(['lineStyle', Logger.LINESTYLE_SCALE_MODE, mode])178 182 } 179 183 public function setLineCapsStyle(caps:String):void { 180 184 this.lineCapsStyle = caps; 181 logWrite(['lineStyle', Logger.LINESTYLE_CAPS, caps])182 185 } 183 186 public function setLineJointStyle(joints:String):void { 184 187 this.lineJointStyle = joints; 185 logWrite(['lineStyle', Logger.LINESTYLE_JOINTS, joints])186 188 } 187 189 public function setLineMiterLimit(miterLimit:Number):void { 188 190 this.lineMiterLimit = miterLimit; 189 logWrite(['lineStyle', Logger.LINESTYLE_MITER_LIMIT, miterLimit])190 191 } 191 192 private function setLineStyle():void { … … 197 198 lineCapsStyle, 198 199 lineJointStyle, 199 lineMiterLimit); 200 lineMiterLimit); 200 201 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 201 237 } 202 238 public function getLineColor():uint { as3/gunyarapaint/trunk/picokakiko/src/picokakiko.as
r1090 r1094 49 49 if (onPost) { 50 50 onPost = false; 51 if (comm.getHttpStatus() == 400|| comm.getError()) {51 if (comm.getHttpStatus() == 202 || comm.getError()) { 52 52 // error 53 53 Alert.show(comm.getStringData(), ALERT_TITLE);

