r16900 by fschmid - Edit Mesh Patches: allow moving of connected patch points together when "SHIFT" key is pressed during mouse move.
scribus-commit
scribus-commit at lists.scribus.net
Wed Oct 12 21:29:15 UTC 2011
Author: fschmid
Date: Wed Oct 12 21:29:15 2011
New Revision: 16900
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16900
Log:
Edit Mesh Patches: allow moving of connected patch points together when "SHIFT" key is pressed during mouse move.
Modified:
trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
Modified: trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16900&path=/trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp Wed Oct 12 21:29:15 2011
@@ -632,41 +632,64 @@
m_canvas->displayXYHUD(m->globalPos(), npf.x(), npf.y());
if (m_view->editStrokeGradient == 9)
{
+ FPoint mp, mp_orig;
+ double xx, yy;
if (m_patchPoint == useTL)
{
- FPoint mp = currItem->meshGradientPatches[currItem->selectedMeshPointX].TL.gridPoint - npx;
- double xx = mp.x();
- double yy = mp.y();
+ mp_orig = currItem->meshGradientPatches[currItem->selectedMeshPointX].TL.gridPoint;
+ mp = mp_orig - npx;
+ xx = mp.x();
+ yy = mp.y();
if (currItem->snapToPatchGrid)
snapToOtherPatch(xx, yy);
currItem->meshGradientPatches[currItem->selectedMeshPointX].TL.moveAbs(xx, yy);
}
if (m_patchPoint == useTR)
{
- FPoint mp = currItem->meshGradientPatches[currItem->selectedMeshPointX].TR.gridPoint - npx;
- double xx = mp.x();
- double yy = mp.y();
+ mp_orig = currItem->meshGradientPatches[currItem->selectedMeshPointX].TR.gridPoint;
+ mp = mp_orig - npx;
+ xx = mp.x();
+ yy = mp.y();
if (currItem->snapToPatchGrid)
snapToOtherPatch(xx, yy);
currItem->meshGradientPatches[currItem->selectedMeshPointX].TR.moveAbs(xx, yy);
}
if (m_patchPoint == useBR)
{
- FPoint mp = currItem->meshGradientPatches[currItem->selectedMeshPointX].BR.gridPoint - npx;
- double xx = mp.x();
- double yy = mp.y();
+ mp_orig = currItem->meshGradientPatches[currItem->selectedMeshPointX].BR.gridPoint;
+ mp = mp_orig - npx;
+ xx = mp.x();
+ yy = mp.y();
if (currItem->snapToPatchGrid)
snapToOtherPatch(xx, yy);
currItem->meshGradientPatches[currItem->selectedMeshPointX].BR.moveAbs(xx, yy);
}
if (m_patchPoint == useBL)
{
- FPoint mp = currItem->meshGradientPatches[currItem->selectedMeshPointX].BL.gridPoint - npx;
- double xx = mp.x();
- double yy = mp.y();
+ mp_orig = currItem->meshGradientPatches[currItem->selectedMeshPointX].BL.gridPoint;
+ mp = mp_orig - npx;
+ xx = mp.x();
+ yy = mp.y();
if (currItem->snapToPatchGrid)
snapToOtherPatch(xx, yy);
currItem->meshGradientPatches[currItem->selectedMeshPointX].BL.moveAbs(xx, yy);
+ }
+ if (m->modifiers() & Qt::ShiftModifier)
+ {
+ for (int col = 0; col < currItem->meshGradientPatches.count(); col++)
+ {
+ if (col != currItem->selectedMeshPointX)
+ {
+ if (currItem->meshGradientPatches[col].TL.gridPoint == mp_orig)
+ currItem->meshGradientPatches[col].TL.moveAbs(xx, yy);
+ if (currItem->meshGradientPatches[col].TR.gridPoint == mp_orig)
+ currItem->meshGradientPatches[col].TR.moveAbs(xx, yy);
+ if (currItem->meshGradientPatches[col].BR.gridPoint == mp_orig)
+ currItem->meshGradientPatches[col].BR.moveAbs(xx, yy);
+ if (currItem->meshGradientPatches[col].BL.gridPoint == mp_orig)
+ currItem->meshGradientPatches[col].BL.moveAbs(xx, yy);
+ }
+ }
}
}
}
More information about the scribus-commit
mailing list