void LayerMoveTool::tabletReleaseEvent(CanvasTabletEvent *event)
{
	PAINTFIELD_DEBUG << "released";
	if (_layerIsDragged)
	{
		_offset = event->data.pos.toQPoint() - _dragStartPoint;
		_layerIsDragged = false;
		clearLayerDelegation();
		canvas()->document()->layerScene()->editLayer(_layer, new LayerMoveEdit(_offset), tr("Layer Move"));
	}
}
Exemple #2
0
void RectTool::updateSelected()
{
	auto layers = layerScene()->selection();
	
	clearLayerDelegation();
	
	d->selectedLayerInfos.clear();
	
	for (const auto &layer : layers)
	{
		Data::LayerInfo info;
		info.setOriginalLayer(layer);
		
		if (layer->isType<AbstractRectLayer>() || layer->isType<RasterLayer>())
			addLayerDelegation(layer);
		
		d->selectedLayerInfos << info;
	}
	
	updateGraphicsItems();
}