- コミット日時:
- 2010/03/13 19:32:28 (3 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/gunyarapaint/branches/gunyarapaint/compat/src/gunyarapaint.as
r3528 r3535 128 128 undoBufferSize = int(parameters['undoBufferSize']); 129 129 130 m_recorder = Recorder.create(width, height, undoBufferSize); 130 var bytes:ByteArray = new ByteArray(); 131 m_recorder = Recorder.create(bytes, width, height, undoBufferSize); 131 132 m_context = new CanvasModuleContext(m_recorder); 132 133 m_module = m_context.getModule(FreeHandModule.FREE_HAND); … … 137 138 m_recorder.addEventListener(UndoEvent.REDO, onChangeUndo); 138 139 m_recorder.addEventListener(UndoEvent.PUSH, onChangeUndo); 139 m_context.add(new MovingCanvasModule(m_recorder, gpCanvasWindow));140 140 } 141 141 … … 211 211 relocateComponents(); 212 212 } 213 m_context.add(new MovingCanvasModule(m_recorder, gpCanvasWindow)); 214 m_module = m_context.getModule(MovingCanvasModule.MOVING_CANVAS); 213 215 } 214 216 as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/controls/MovingCanvasModule.as
r3528 r3535 1 1 package org.libspark.gunyarapaint.controls 2 2 { 3 import flash.geom.Point; 4 3 5 import org.libspark.gunyarapaint.framework.Recorder; 6 import org.libspark.gunyarapaint.framework.modules.CanvasModule; 4 7 import org.libspark.gunyarapaint.framework.modules.ICanvasModule; 5 import org.libspark.gunyarapaint.framework.modules.CanvasModule;6 8 7 9 public final class MovingCanvasModule extends CanvasModule implements ICanvasModule … … 17 19 public function start(x:Number, y:Number):void 18 20 { 21 m_scrollPosition = m_canvas.canvasScrollPosition; 22 setCoordinate(x, y); 19 23 } 20 24 21 25 public function move(x:Number, y:Number):void 22 26 { 27 var scale:Number = m_canvas.scaleX; 28 if (scale < 1) 29 scale = 1.0 / (-scale + 2); 30 var x:Number = m_scrollPosition.x + (coordinateX - x) * scale; 31 var y:Number = m_scrollPosition.y + (coordinateY - y) * scale; 32 m_canvas.scroll(x, y); 23 33 } 24 34 … … 37 47 38 48 private var m_canvas:GPCanvasWindowControl; 49 private var m_scrollPosition:Point; 39 50 } 40 51 }

