Esempio n. 1
0
void MapEditorToolBase::abortEditing()
{
	Q_ASSERT(editingInProgress());
	
	resetEditedObjects();
	finishEditingSelection(*renderables, *old_renderables, false);
	setEditingInProgress(false);
}
Esempio n. 2
0
void ScaleTool::updateDragging(const MapCoordF cursor_pos_map)
{
	if (scaling)
	{
		double scaling = (cursor_pos_map - scaling_center).length();
		scaling_factor = scaling / qMax(1e-7, original_scale);
		
		resetEditedObjects();
		Map::ObjectSelection::const_iterator it_end = map()->selectedObjectsEnd();
		for (Map::ObjectSelection::const_iterator it = map()->selectedObjectsBegin(); it != it_end; ++it)
			(*it)->scale(scaling_center, scaling_factor);
		updatePreviewObjects();
		updateStatusText();
	}
}