チェンジセット 3741: as3/gunyarapaint
- コミット日時:
- 2010/04/10 18:47:58 (3 年前)
- ファイル:
-
- as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/CommandContext.as (更新) (3 diffs)
- as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/Painter.as (更新) (10 diffs)
- as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/CompatibilityCommand.as (追加)
- as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/modules/CanvasModule.as (更新) (2 diffs)
- as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/modules/ICanvasModule.as (更新) (1 diff)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/CommandContext.as
r3685 r3741 5 5 import org.libspark.gunyarapaint.framework.commands.BeginFillCommand; 6 6 import org.libspark.gunyarapaint.framework.commands.BezierCurveCommand; 7 import org.libspark.gunyarapaint.framework.commands.CompatibilityCommand; 7 8 import org.libspark.gunyarapaint.framework.commands.CompositeCommand; 8 9 import org.libspark.gunyarapaint.framework.commands.DrawCircleCommand; … … 70 71 * 27 = MoveLayerCommand 71 72 * 28 = BezierCurveCommand 73 * 29 = CompatibilityCommand 72 74 */ 73 75 public function CommandContext() 74 76 { 75 77 m_commands = new Vector.<ICommand>(MAX_COMMANDS, true); 76 registerCommand(new BezierCurveCommand());77 78 registerCommand(new CopyLayerCommand()); 78 79 registerCommand(new CreateLayerCommand()); … … 87 88 registerCommand(new SwapLayerCommand()); 88 89 registerCommand(new BeginFillCommand()); 90 registerCommand(new BezierCurveCommand()); 91 registerCommand(new CompatibilityCommand); 89 92 registerCommand(new CompositeCommand()); 90 93 registerCommand(new DrawCircleCommand()); as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/Painter.as
r3719 r3741 39 39 40 40 /** 41 * レイヤー作成をアンドゥに含めるかどうかのオプション 42 * 43 */ 44 public static const COMPATIBILITY_UNDO_LAYER:uint = 1; 45 46 /** 47 * 1 ピクセル以上の大きさを持つ PixelCommand を有効にするかどうかのオプション 48 * 49 */ 50 public static const COMPATIBILITY_BIG_PIXEL:uint = 2; 51 52 /** 41 53 * 反転関連で全てのレイヤーに対して適用するための定数 42 54 * … … 46 58 public function Painter(width:uint, height:uint, version:uint, paintEngine:PaintEngine) 47 59 { 60 enableBigPixel = true; 61 enableUndoLayer = false; 48 62 m_layers = new LayerBitmapCollection(width, height); 49 63 m_drawingSprite = new Sprite(); … … 114 128 public function pushUndoIfNeed():void 115 129 { 116 if (m_version <= 21 )130 if (m_version <= 21 || enableUndoLayer) 117 131 pushUndo(); 118 132 } … … 549 563 * 現在のお絵描きログのバージョンを返す 550 564 * 551 * @return ログのバージョン552 565 */ 553 566 public function get version():uint … … 559 572 * 描写するキャンバスの幅を返す 560 573 * 561 * @return 画像の幅562 574 */ 563 575 public function get width():uint … … 569 581 * 描写するキャンバスの高さを返す 570 582 * 571 * @return 画像の高さ572 583 */ 573 584 public function get height():uint … … 576 587 } 577 588 589 /** 590 * UndoStack オブジェクトを返す 591 * 592 */ 578 593 public function get undoStack():UndoStack 579 594 { … … 581 596 } 582 597 598 /** 599 * レイヤーを保存するために必要な BitmapData を生成する 600 * 601 */ 583 602 public function get newLayerBitmapData():BitmapData 584 603 { … … 616 635 617 636 /** 637 * ログのバージョンを設定する 638 * 639 */ 640 internal function setVersion(value:uint):void 641 { 642 m_version = value; 643 } 644 645 /** 618 646 * UndoStack オブジェクトを設定する 619 647 * 620 * @return ログのバージョン621 648 */ 622 649 internal function setUndoStack(value:UndoStack):void … … 624 651 m_undo = value; 625 652 } 653 654 public var enableUndoLayer:Boolean; 655 656 public var enableBigPixel:Boolean; 626 657 627 658 // テストでLayerBitmapCollectionの差し替えを行うため敢えてprotected にしてある as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/modules/CanvasModule.as
r3605 r3741 5 5 import org.libspark.gunyarapaint.framework.LayerBitmap; 6 6 import org.libspark.gunyarapaint.framework.Recorder; 7 import org.libspark.gunyarapaint.framework.commands.CompatibilityCommand; 7 8 import org.libspark.gunyarapaint.framework.commands.HorizontalMirrorCommand; 8 9 import org.libspark.gunyarapaint.framework.commands.PenCommand; … … 101 102 } 102 103 104 public function setCompatibility(type:uint, value:Boolean):void 105 { 106 m_recorder.commitCommand( 107 CompatibilityCommand.ID, 108 { 109 "type": type, 110 "value": value 111 } 112 ); 113 } 114 103 115 /** 104 116 * 始点と終点を取得する(現在は単体テスト用に使われているのみ) as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/modules/ICanvasModule.as
r3569 r3741 98 98 99 99 /** 100 * 挙動の互換性オプションを設定する 101 * 102 * @param type 互換性名 103 * @param value 有効あるいは無効 104 */ 105 function setCompatibility(type:uint, value:Boolean):void; 106 107 /** 100 108 * モジュール名を返す 101 109 *

