チェンジセット 1104
- コミット日時:
- 2008/08/27 18:16:57 (5 年前)
- ファイル:
-
- as3/gunyarapaint/trunk/colorpicker (追加)
- as3/gunyarapaint/trunk/gunyarapaint/.project (更新) (1 diff)
- as3/gunyarapaint/trunk/gunyarapaint/libs/sephiroth_ColorPicker.swc (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/com (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/com/adobe (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/com/adobe/images (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/com/adobe/images/PNGEncoder.as (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint.as (更新) (10 diffs)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint.mxml (更新) (2 diffs)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Canvas.as (更新) (7 diffs)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Logger.as (更新) (5 diffs)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/controls (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/controls/PenDetailControl.mxml (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/controls/PenDetailControlScript.as (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/entities (追加)
- as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/entities/GPPen.as (追加)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/gunyarapaint/trunk/gunyarapaint/.project
r1073 r1104 4 4 <comment></comment> 5 5 <projects> 6 <project>nicopedia</project> 6 7 </projects> 7 8 <buildSpec> as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint.as
r1101 r1104 1 private const DEBUG:Boolean = true; 2 1 3 import flash.events.Event; 4 import flash.events.MouseEvent; 2 5 3 6 import gunyarapaint.Canvas; … … 5 8 6 9 import mx.controls.Alert; 7 import mx.events.ColorPickerEvent;8 10 import mx.events.FlexEvent; 9 import mx.events.ListEvent;10 11 import mx.events.NumericStepperEvent; 11 12 import mx.events.SliderEvent; … … 24 25 25 26 private const ALERT_TITLE:String = 'お絵カキコ'; 26 private const DEBUG:Boolean = false;27 27 private const MAX_CANVAS_WIDTH:uint = 500; 28 28 private const MAX_CANVAS_HEIGHT:uint = 500; … … 88 88 } 89 89 90 // 太さ 91 thicknessStepper.addEventListener(NumericStepperEvent.CHANGE, thicknessStepperHandler); 92 // カラーピッカ 93 colorPicker.addEventListener(ColorPickerEvent.CHANGE, colorPickerHandler); 94 // スポイト 95 dropperButton.addEventListener(Event.CHANGE, dropperButtonHandler); 96 // 透明度 97 alphaSlider.addEventListener(SliderEvent.CHANGE, alphaSliderHandler); 90 // ペン詳細 91 penDetail.addEventListener('changePen', changePenHandler); 92 93 // 回転のときに勝手にApplicationの領域が拡大しないように 94 canvas.explicitWidth = 0; 95 canvas.explicitHeight = 0; 96 98 97 // キャンバス回転 99 98 canvasRotate.addEventListener(SliderEvent.CHANGE, canvasRotateHandler); 100 99 canvasRotate.addEventListener(SliderEvent.THUMB_DRAG, canvasRotateHandler); 101 // 回転のときに勝手にApplicationの領域が拡大しないように102 canvas.explicitWidth = 0;103 canvas.explicitHeight = 0;104 105 // ブレンドモード106 blendModeComboBox.dataProvider = [107 {label: '通常', data: flash.display.BlendMode.NORMAL},108 // {label: '消去', data: flash.display.BlendMode.ERASE},109 {label: '比較(暗)', data: flash.display.BlendMode.DARKEN},110 {label: '乗算', data: flash.display.BlendMode.MULTIPLY},111 {label: '比較(明)', data: flash.display.BlendMode.LIGHTEN},112 {label: 'スクリーン', data: flash.display.BlendMode.SCREEN},113 {label: '覆い焼き', data: flash.display.BlendMode.ADD},114 {label: 'オーバーレイ', data: flash.display.BlendMode.OVERLAY},115 {label: 'ハードライト', data: flash.display.BlendMode.HARDLIGHT},116 {label: '差の絶対値', data: flash.display.BlendMode.DIFFERENCE},117 {label: '除外', data: flash.display.BlendMode.SUBTRACT},118 {label: '反転', data: flash.display.BlendMode.INVERT}];119 blendModeComboBox.addEventListener(ListEvent.CHANGE, blendModeComboBoxHandler);120 100 121 101 // アンドゥ・リドゥ … … 137 117 canvas.height = canvasHeight; 138 118 canvas.addChild(gpCanvas); 139 // スポイトで色取ったイベント140 gpCanvas.addEventListener('changeColor', changeColorHandler);119 ///// スポイトで色取ったイベント 120 // gpCanvas.addEventListener('changeColor', changeColorHandler); 141 121 // undo/redoの状態変化 142 122 gpCanvas.addEventListener('changeUndoRedo', changeUndoRedoHandler); … … 146 126 this.height = canvasHeight + canvas.y + 10; 147 127 148 canvas.x = 10;149 128 basex = canvas.x; 150 129 basey = canvas.y; … … 179 158 this.enabled = true; 180 159 } 181 }182 183 private function thicknessStepperHandler(evt:NumericStepperEvent):void {184 gpCanvas.setLineThickness(evt.value);185 }186 187 private function colorPickerHandler(evt:ColorPickerEvent):void {188 gpCanvas.setLineColor(evt.target.selectedColor);189 }190 191 private function alphaSliderHandler(evt:SliderEvent):void {192 gpCanvas.setLineAlpha(evt.value);193 160 } 194 161 … … 248 215 } 249 216 250 private function blendModeComboBoxHandler(evt:ListEvent):void {251 gpCanvas.setLineBlendMode(String(evt.currentTarget.value));252 }253 217 private function undoButtonHandler(evt:FlexEvent):void { 254 218 gpCanvas.undo(); … … 256 220 private function redoButtonHandler(evt:FlexEvent):void { 257 221 gpCanvas.redo(); 258 }259 private function dropperButtonHandler(evt:Event):void {260 if (evt.target.selected) {261 gpCanvas.setPenMode(gpCanvas.MODE_DROPPER);262 } else {263 gpCanvas.setPenMode(gpCanvas.MODE_PEN);264 }265 }266 private function changeColorHandler(evt:Event):void {267 colorPicker.selectedColor = gpCanvas.getLineColor();268 alphaSlider.value = 1.0;269 222 } 270 223 private function additionalNumberStepperHandler(evt:NumericStepperEvent):void { … … 313 266 oekakiId); 314 267 } 268 269 private function changePenHandler(evt:Event):void { 270 gpCanvas.pen = penDetail.pen; 271 } as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint.mxml
r1102 r1104 2 2 <mx:Application 3 3 xmlns:mx="http://www.adobe.com/2006/mxml" 4 layout="absolute" width="640" height="484" 4 xmlns:gpcontrol="gunyarapaint.controls.*" 5 layout="absolute" width="736" height="662" 5 6 creationComplete="init()" 6 7 borderStyle="solid" cornerRadius="0" borderColor="#333333" … … 9 10 <mx:Script source="gunyarapaint.as"> 10 11 </mx:Script> 11 <mx:Canvas id="toolCanvas" x="0" y="0" width=" 630">12 <mx:Label id="versionLabel" x=" 365" y="9" text="ver.2008050601"/>12 <mx:Canvas id="toolCanvas" x="0" y="0" width="719" height="102"> 13 <mx:Label id="versionLabel" x="238" y="9" text="ver.2008050601"/> 13 14 <mx:Label x="28" y="7" text="名前"/> 14 15 <mx:TextInput id="fromTextInput" x="55" y="3" maxChars="32" fontSize="14"/> 15 16 <mx:Label x="10" y="51" text="書き込み"/> 16 <mx:TextArea id="messageTextArea" x="55" y="33" width=" 563" height="61" fontSize="14">17 <mx:TextArea id="messageTextArea" x="55" y="33" width="406" height="61" fontSize="14"> 17 18 <mx:text></mx:text> 18 19 </mx:TextArea> 19 <mx:Label x="10" y="99" text="ペンの太さ"/> 20 <mx:NumericStepper id="thicknessStepper" x="69" y="97" value="3" minimum="1" maximum="30" stepSize="1"/> 21 <mx:Label x="136" y="99" text="ペンの色"/> 22 <mx:ColorPicker id="colorPicker" x="184" y="97"/> 23 <mx:Button id="dropperButton" x="214" y="97" toggle="true" icon="@Embed(source='../imgs/icon_dropper.png')" width="28"/> 24 <mx:Label x="253" y="99" text="ペンの透明度"/> 25 <mx:HSlider id ="alphaSlider" x="324" y="97" width="100" minimum="0" maximum="1" snapInterval="0.05" value="1"/> 26 <mx:ComboBox id="blendModeComboBox" x="451" y="97" width="134"> 27 </mx:ComboBox> 28 <mx:Label x="10" y="125" text="キャンバスの角度"/> 29 <mx:HSlider id="canvasRotate" x="86" y="124" width="152" minimum="-180" maximum="180" snapInterval="5" value="0" /> 30 <mx:Button id="undoButton" x="250" y="123" label="アンドゥ" enabled="false" paddingLeft="3" paddingRight="3"/> 31 <mx:Button id="redoButton" x="331" y="123" label="リドゥ" enabled="false" paddingLeft="3" paddingRight="3"/> 32 <mx:Label x="396" y="125" text="補助線"/> 33 <mx:NumericStepper id="additionalNumberStepper" x="434" y="123" value="4" minimum="2" maximum="10" stepSize="1"/> 34 <mx:CheckBox id="additionalBoxCheckBox" x="500" y="123" label="縦横"/> 35 <mx:CheckBox id="additionalSkewCheckBox" x="553" y="123" label="斜め"/> 36 <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"/> 20 <mx:Label x="469" y="76" text="キャンバスの角度"/> 21 <mx:HSlider id="canvasRotate" x="558" y="76" width="152" minimum="-180" maximum="180" snapInterval="5" value="0" /> 22 <mx:Label x="517" y="12" text="補助線"/> 23 <mx:NumericStepper id="additionalNumberStepper" x="555" y="10" value="4" minimum="2" maximum="10" stepSize="1"/> 24 <mx:CheckBox id="additionalBoxCheckBox" x="621" y="10" label="縦横"/> 25 <mx:CheckBox id="additionalSkewCheckBox" x="674" y="10" label="斜め"/> 26 <mx:Button id="postOekakiButton" x="353" y="7" label="お絵カキコする!" fillAlphas="[1.0, 1.0, 1.0, 1.0]" fillColors="[#FFFFFF, #FF9999, #FFFFFF, #FFCCCC]" enabled="false"/> 27 <mx:Button id="undoButton" x="469" y="49" label="アンドゥ" enabled="false" paddingLeft="3" paddingRight="3"/> 28 <mx:Button id="redoButton" x="573" y="49" label="リドゥ" enabled="false" paddingLeft="3" paddingRight="3"/> 37 29 </mx:Canvas> 38 <mx:Canvas id="canvas" width="400" height="300" x="10" y="172"></mx:Canvas> 30 <mx:Canvas id="canvas" width="400" height="300" x="255" y="288"> 31 </mx:Canvas> 32 <gpcontrol:PenDetailControl id="penDetail" x="8" y="129"> 33 </gpcontrol:PenDetailControl> 39 34 </mx:Application> as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Canvas.as
r1103 r1104 1 1 package gunyarapaint 2 2 { 3 import com.adobe.images.PNGEncoder; 4 3 5 import flash.display.Bitmap; 4 6 import flash.display.BitmapData; … … 13 15 import flash.utils.ByteArray; 14 16 import flash.utils.clearInterval; 17 18 import gunyarapaint.entities.GPPen; 15 19 16 20 import mx.core.UIComponent; … … 41 45 private var canWidth:uint, canHeight:uint; 42 46 43 private var isPreLineStyle:Boolean = false; 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 53 private var lineThickness:uint; 54 private var lineColor:uint; 55 private var lineAlpha:Number; 56 private var lineBlendMode:String; 57 private var lineScaleMode:String; 58 private var lineCapsStyle:String; 59 private var lineJointStyle:String; 60 private var lineMiterLimit:Number; 61 47 private var _pen:GPPen = null; 48 private var _prePen:GPPen = null; 49 62 50 public function Canvas(width:uint, height:uint, undoBufferSize:uint, logger:Logger, baseData:BitmapData) 63 51 { … … 110 98 111 99 // ペン関連の初期化 112 setLineThickness(3); 113 setLineColor(0x000000); 114 setLineAlpha(1); 115 setLineBlendMode(flash.display.BlendMode.NORMAL); 116 setLineScaleMode(LineScaleMode.NORMAL); 117 setLineCapsStyle(CapsStyle.ROUND); 118 setLineJointStyle(JointStyle.ROUND); 119 setLineMiterLimit(3); 100 _pen = new GPPen(); 101 _pen.thickness= 3; 102 _pen.color= 0x000000; 103 _pen.alpha= 1; 104 _pen.blendMode= flash.display.BlendMode.NORMAL; 105 _pen.scaleMode= LineScaleMode.NORMAL; 106 _pen.capsStyle= CapsStyle.ROUND; 107 _pen.jointStyle= JointStyle.ROUND; 108 _pen.miterLimit= 3; 109 _pen.pixelHinting= true; 120 110 121 111 super(); … … 168 158 } 169 159 170 public function setLineThickness(t:uint):void { 171 if (t > 255) { 172 // ToDo: alert 173 return; 174 } 175 this.lineThickness = t; 176 } 177 public function setLineColor(color:uint):void { 178 this.lineColor = color; 179 } 180 public function setLineAlpha(alpha:Number):void { 181 this.lineAlpha = alpha; 182 } 183 public function setLineBlendMode(blend:String):void { 184 this.lineBlendMode = blend; 185 } 186 public function setLineScaleMode(mode:String):void { 187 this.lineScaleMode = mode; 188 } 189 public function setLineCapsStyle(caps:String):void { 190 this.lineCapsStyle = caps; 191 } 192 public function setLineJointStyle(joints:String):void { 193 this.lineJointStyle = joints; 194 } 195 public function setLineMiterLimit(miterLimit:Number):void { 196 this.lineMiterLimit = miterLimit; 197 } 160 public function set pen(pen:GPPen):void { 161 _pen = pen; 162 } 163 198 164 private function setLineStyle():void { 199 lineShape.graphics.lineStyle(lineThickness, 200 lineColor, 201 lineAlpha, 202 true, 203 lineScaleMode, 204 lineCapsStyle, 205 lineJointStyle, 206 lineMiterLimit); 207 lineShape.blendMode = lineBlendMode; 165 // TODO: pixel hintingのパラメータつける… 166 lineShape.graphics.lineStyle(_pen.thickness, 167 _pen.color, 168 _pen.alpha, 169 _pen.pixelHinting, 170 _pen.scaleMode, 171 _pen.capsStyle, 172 _pen.jointStyle, 173 _pen.miterLimit); 174 175 lineShape.blendMode = _pen.blendMode; 208 176 209 177 if (writeLog) { 210 if (isPreLineStyle) { 211 if (preLineThickness != lineThickness) { 212 logWrite(['lineStyle', Logger.LINESTYLE_THICKNESS, lineThickness]); 213 } 214 if (preLineColor != lineColor) { 215 logWrite(['lineStyle', Logger.LINESTYLE_COLOR, lineColor]); 216 } 217 if (preLineAlpha != lineAlpha) { 218 logWrite(['lineStyle', Logger.LINESTYLE_ALPHA, lineAlpha]); 219 } 220 if (preLineBlendMode != lineBlendMode) { 221 logWrite(['lineStyle', Logger.LINESTYLE_BLEND_MODE, lineBlendMode]); 222 } 223 if (preLineScaleMode != lineScaleMode) { 224 logWrite(['lineStyle', Logger.LINESTYLE_SCALE_MODE, lineScaleMode]); 225 } 226 if (preLineCapsStyle != lineCapsStyle) { 227 logWrite(['lineStyle', Logger.LINESTYLE_CAPS, lineCapsStyle]); 228 } 229 if (preLineJointStyle != lineJointStyle) { 230 logWrite(['lineStyle', Logger.LINESTYLE_JOINTS, lineJointStyle]); 231 } 232 if (preLineMiterLimit != lineMiterLimit) { 233 logWrite(['lineStyle', Logger.LINESTYLE_MITER_LIMIT, lineMiterLimit]); 178 if (_prePen != null) { 179 if (_prePen.thickness != _pen.thickness) { 180 logWrite(['lineStyle', Logger.LINESTYLE_THICKNESS, _pen.thickness]); 181 } 182 if (_prePen.color != _pen.color) { 183 logWrite(['lineStyle', Logger.LINESTYLE_COLOR, _pen.color]); 184 } 185 if (_prePen.alpha != _pen.alpha) { 186 logWrite(['lineStyle', Logger.LINESTYLE_ALPHA, _pen.alpha]); 187 } 188 if (_prePen.blendMode != _pen.blendMode) { 189 logWrite(['lineStyle', Logger.LINESTYLE_BLEND_MODE, _pen.blendMode]); 190 } 191 if (_prePen.scaleMode != _pen.scaleMode) { 192 logWrite(['lineStyle', Logger.LINESTYLE_SCALE_MODE, _pen.scaleMode]); 193 } 194 if (_prePen.capsStyle != _pen.capsStyle) { 195 logWrite(['lineStyle', Logger.LINESTYLE_CAPS, _pen.capsStyle]); 196 } 197 if (_prePen.jointStyle != _pen.jointStyle) { 198 logWrite(['lineStyle', Logger.LINESTYLE_JOINTS, _pen.jointStyle]); 199 } 200 if (_prePen.miterLimit != _pen.miterLimit) { 201 logWrite(['lineStyle', Logger.LINESTYLE_MITER_LIMIT, _pen.miterLimit]); 202 } 203 if (_prePen.pixelHinting != _pen.pixelHinting) { 204 logWrite(['lineStyle', Logger.LINESTYLE_PIXEL_HINTING, _pen.pixelHinting]); 234 205 } 235 206 } else { 236 logWrite(['lineStyle', Logger.LINESTYLE_THICKNESS, lineThickness]); 237 logWrite(['lineStyle', Logger.LINESTYLE_COLOR, lineColor]); 238 logWrite(['lineStyle', Logger.LINESTYLE_ALPHA, lineAlpha]); 239 logWrite(['lineStyle', Logger.LINESTYLE_BLEND_MODE, lineBlendMode]); 240 logWrite(['lineStyle', Logger.LINESTYLE_SCALE_MODE, lineScaleMode]); 241 logWrite(['lineStyle', Logger.LINESTYLE_CAPS, lineCapsStyle]); 242 logWrite(['lineStyle', Logger.LINESTYLE_JOINTS, lineJointStyle]); 243 logWrite(['lineStyle', Logger.LINESTYLE_MITER_LIMIT, lineMiterLimit]); 244 isPreLineStyle = true; 245 } 246 preLineThickness = lineThickness; 247 preLineColor = lineColor; 248 preLineAlpha = lineAlpha; 249 preLineBlendMode = lineBlendMode; 250 preLineScaleMode = lineScaleMode; 251 preLineCapsStyle = lineCapsStyle; 252 preLineJointStyle = lineJointStyle; 253 preLineMiterLimit = lineMiterLimit; 254 } 255 } 256 public function getLineColor():uint { 257 return this.lineColor; 258 } 259 public function getLineAlpha():uint { 260 return this.lineAlpha; 261 } 207 // 初回は全部書く 208 logWrite(['lineStyle', Logger.LINESTYLE_THICKNESS, _pen.thickness]); 209 logWrite(['lineStyle', Logger.LINESTYLE_COLOR, _pen.color]); 210 logWrite(['lineStyle', Logger.LINESTYLE_ALPHA, _pen.alpha]); 211 logWrite(['lineStyle', Logger.LINESTYLE_BLEND_MODE, _pen.blendMode]); 212 logWrite(['lineStyle', Logger.LINESTYLE_SCALE_MODE, _pen.scaleMode]); 213 logWrite(['lineStyle', Logger.LINESTYLE_CAPS, _pen.capsStyle]); 214 logWrite(['lineStyle', Logger.LINESTYLE_JOINTS, _pen.jointStyle]); 215 logWrite(['lineStyle', Logger.LINESTYLE_MITER_LIMIT, _pen.miterLimit]); 216 logWrite(['lineStyle', Logger.LINESTYLE_PIXEL_HINTING, _pen.pixelHinting]); // 最初のverでは書かれていない 217 } 218 _prePen = _pen; 219 } 220 } 221 262 222 private function getColor(evt:MouseEvent):void { 223 // FIXME: スポイトあとでなおす 263 224 var rgb:uint = data.getPixel(evt.localX, evt.localY); 264 setLineColor(rgb);265 setLineAlpha(1.0);225 // setLineColor(rgb); 226 // setLineAlpha(1.0); 266 227 this.dispatchEvent(new Event('changeColor')); 267 228 } … … 329 290 public function drawShapeOnBitmap():void { 330 291 // 描画 331 data.draw(lineShape, null, null, lineBlendMode, null, false);292 data.draw(lineShape, null, null, _pen.blendMode, null, false); 332 293 // リングバッファに追加して 333 294 // TODO: avoid GC … … 478 439 switch (a[1]) { 479 440 case Logger.LINESTYLE_THICKNESS: 480 setLineThickness(a[2]);441 _pen.thickness = a[2]; 481 442 break; 482 443 case Logger.LINESTYLE_COLOR: 483 setLineColor(a[2]);444 _pen.color = a[2]; 484 445 break; 485 446 case Logger.LINESTYLE_ALPHA: 486 setLineAlpha(a[2]);447 _pen.alpha = a[2]; 487 448 break; 488 449 case Logger.LINESTYLE_BLEND_MODE: 489 setLineBlendMode(a[2]);450 _pen.blendMode = a[2]; 490 451 break; 491 452 case Logger.LINESTYLE_SCALE_MODE: 492 setLineScaleMode(a[2]);453 _pen.scaleMode = a[2]; 493 454 break; 494 455 case Logger.LINESTYLE_CAPS: 495 setLineCapsStyle(a[2]);456 _pen.capsStyle = a[2]; 496 457 break; 497 458 case Logger.LINESTYLE_JOINTS: 498 setLineJointStyle(a[2]);459 _pen.jointStyle = a[2]; 499 460 break; 500 461 case Logger.LINESTYLE_MITER_LIMIT: 501 setLineMiterLimit(a[2]); 462 _pen.miterLimit = a[2]; 463 break; 464 case Logger.LINESTYLE_PIXEL_HINTING: 465 _pen.pixelHinting = a[2]; 502 466 break; 503 467 } as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Logger.as
r1103 r1104 71 71 public static const LINESTYLE_JOINTS:uint = 7; 72 72 public static const LINESTYLE_MITER_LIMIT:uint = 8; 73 public static const LINESTYLE_PIXEL_HINTING:uint = 9; // NB: not used! first version, this is true 73 74 74 75 public function write(info:Array):void { … … 132 133 writeUTF(info[2]); 133 134 break; 135 case Logger.LINESTYLE_PIXEL_HINTING: 136 writeBoolean(info[2]); 137 break; 134 138 } 135 139 break; … … 174 178 log.writeUTF(value); 175 179 } 180 private function writeBoolean(value:Boolean):void { 181 log.writeByte(value ? 1 : 0); 182 } 176 183 private function readByte():uint { 177 184 return log.readUnsignedByte(); … … 191 198 private function readUTF():String { 192 199 return log.readUTF(); 200 } 201 private function readBoolean():Boolean { 202 return (log.readByte() == 1); 193 203 } 194 204 public function read():Array { … … 231 241 case Logger.LINESTYLE_JOINTS: 232 242 obj = readUTF(); 243 break; 244 case Logger.LINESTYLE_PIXEL_HINTING: 245 obj = readBoolean(); 233 246 break; 234 247 }

