チェンジセット 3804: as3/gunyarapaint

差分発生行の前後
無視リスト:
コミット日時:
2010/04/16 02:24:35 (3 年前)
コミッタ:
hkrn
ログメッセージ:

fixed a bug that doesn't recover the blendmode of the pen using TransparentLineModule?

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/modules/TransparentLineModule.as

    r3801 r3804  
    2222            validateLayerState(); 
    2323            setCoordinate(x, y); 
    24             m_blendMode = m_recorder.layers.currentLayer.blendMode; 
     24            m_blendMode = m_recorder.pen.blendMode; 
    2525            m_recorder.startDrawingSession(); 
    2626        } 
     
    5050                blendMode = m_blendMode; 
    5151            } 
    52             m_recorder.currentLayerBlendMode = m_blendMode; 
     52            m_recorder.pen.blendMode = m_blendMode; 
    5353            saveCoordinate(x, y); 
    5454        } 
  • as3/gunyarapaint/branches/gunyarapaint/test/src/org/libspark/gunyarapaint/framework/module/TransparentFloodFillTest.as

    r3605 r3804  
    44     
    55    import org.flexunit.Assert; 
     6    import org.libspark.gunyarapaint.framework.Pen; 
    67    import org.libspark.gunyarapaint.framework.Recorder; 
    78    import org.libspark.gunyarapaint.framework.modules.CanvasModuleContext; 
     
    1516        { 
    1617            m_bytes = new ByteArray(); 
    17             var recorder:Recorder = ModuleTestUtil.createRecorder(m_bytes); 
    18             var context:CanvasModuleContext = new CanvasModuleContext(recorder); 
     18            m_recorder = ModuleTestUtil.createRecorder(m_bytes); 
     19            var context:CanvasModuleContext = new CanvasModuleContext(m_recorder); 
    1920            m_module = context.getModule(TransparentFloodFill.TRANSPARENT_FLOOD_FILL); 
    2021        } 
     
    3031        public function floodFill():void 
    3132        { 
     33            var pen:Pen = m_recorder.pen; 
     34            pen.alpha = 0.5; 
     35            pen.color = 0x123456; 
    3236            m_module.start(1, 1); 
    3337            m_module.move(2, 2); 
    3438            m_module.stop(3, 3); 
    3539            ModuleTestUtil.countCommands(6, m_bytes); 
     40            Assert.assertStrictlyEquals(0.5, pen.alpha); 
     41            Assert.assertStrictlyEquals(0x123456, pen.color); 
    3642        } 
    3743         
     
    4349         
    4450        private var m_bytes:ByteArray; 
     51        private var m_recorder:Recorder; 
    4552        private var m_module:ICanvasModule; 
    4653    } 
  • as3/gunyarapaint/branches/gunyarapaint/test/src/org/libspark/gunyarapaint/framework/module/TransparentLineTest.as

    r3801 r3804  
    11package org.libspark.gunyarapaint.framework.module 
    22{ 
     3    import flash.display.BlendMode; 
    34    import flash.utils.ByteArray; 
    45     
     
    1516        { 
    1617            m_bytes = new ByteArray(); 
    17             var recorder:Recorder = ModuleTestUtil.createRecorder(m_bytes); 
    18             var context:CanvasModuleContext = new CanvasModuleContext(recorder); 
     18            m_recorder = ModuleTestUtil.createRecorder(m_bytes); 
     19            var context:CanvasModuleContext = new CanvasModuleContext(m_recorder); 
    1920            m_module = context.getModule(TransparentLineModule.TRANSPARENT_LINE); 
    2021        } 
     
    3031        public function drawWithoutMoving():void 
    3132        { 
     33            m_recorder.pen.blendMode = BlendMode.ADD; 
    3234            m_module.start(1, 1); 
    3335            m_module.stop(1, 1); 
    3436            ModuleTestUtil.countCommands(0, m_bytes); 
     37            Assert.assertStrictlyEquals(BlendMode.ADD, m_recorder.pen.blendMode); 
    3538        } 
    3639         
     
    3841        public function drawWithMoving():void 
    3942        { 
     43            m_recorder.pen.blendMode = BlendMode.DARKEN; 
    4044            m_module.start(1, 1); 
    4145            m_module.move(2, 2); 
    4246            m_module.stop(3, 3); 
    4347            ModuleTestUtil.countCommands(5, m_bytes); 
     48            Assert.assertStrictlyEquals(BlendMode.DARKEN, m_recorder.pen.blendMode); 
    4449        } 
    4550         
     
    5156         
    5257        private var m_bytes:ByteArray; 
     58        private var m_recorder:Recorder; 
    5359        private var m_module:ICanvasModule; 
    5460    }