Index: as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/ui/v1/LayerController.mxml =================================================================== --- as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/ui/v1/LayerController.mxml (リビジョン 3913) +++ as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/ui/v1/LayerController.mxml (リビジョン 3953) @@ -80,13 +80,13 @@ } - private function onClickLayer(evt:ListEvent):void - { - var app:IApplication = IApplication(Application.application); - var layer:LayerBitmap = LayerBitmap(evt.currentTarget.selectedItem); + private function onClickLayer(event:ListEvent):void + { + var app:IApplication = IApplication(Application.application); + var layer:LayerBitmap = LayerBitmap(event.currentTarget.selectedItem); if (app.layers.currentIndex != layer.index) app.canvasModule.layerIndex = layer.index; } - private function onCreateLayer(evt:Event):void + private function onCreateLayer(event:Event):void { try { @@ -100,5 +100,5 @@ } - private function onCopyLayer(evt:Event):void + private function onCopyLayer(event:Event):void { try { @@ -112,5 +112,5 @@ } - private function onRemoveLayer(evt:Event):void + private function onRemoveLayer(event:Event):void { try { @@ -124,5 +124,5 @@ } - private function onMergeLayers(evt:Event):void + private function onMergeLayers(event:Event):void { try { @@ -136,19 +136,19 @@ } - private function itemCheckChangeHandler(evt:Event):void + private function itemCheckChangeHandler(event:Event):void { // do nothing... } - private function onChangeAlphaSlider(evt:SliderEvent):void - { - var app:IApplication = IApplication(Application.application); - app.canvasModule.layerAlpha = evt.value; - } - - private function onSelectBlendMode(evt:ListEvent):void - { - var app:IApplication = IApplication(Application.application); - app.canvasModule.layerBlendMode = String(evt.currentTarget.value); + private function onChangeAlphaSlider(event:SliderEvent):void + { + var app:IApplication = IApplication(Application.application); + app.canvasModule.layerAlpha = event.value; + } + + private function onSelectBlendMode(event:ListEvent):void + { + var app:IApplication = IApplication(Application.application); + app.canvasModule.layerBlendMode = String(event.currentTarget.value); } @@ -158,5 +158,11 @@ } - private function onDragComplete(evt:DragEvent):void + private function onDragStart(event:DragEvent):void + { + var app:IApplication = IApplication(Application.application); + m_selectedIndex = getSelectedIndex(app.layers); + } + + private function onDragComplete(event:DragEvent):void { var app:IApplication = IApplication(Application.application); @@ -169,7 +175,10 @@ if (a[i].index != to) { app.canvasModule.swapLayers(from, to); - break; + return; } } + // レイヤーの入れ替え処理がなかった場合はレイヤーの選択位置に戻すように + // (例えばレイヤーウィンドウ外にレイヤーをドラッグした時とか) + layerDataGrid.selectedIndex = m_selectedIndex; } @@ -180,8 +189,9 @@ private var m_initPosition:Point; + private var m_selectedIndex:uint; ]]> + itemClick="onClickLayer(event)" dragStart="onDragStart(event)" dragComplete="onDragComplete(event)">