Enhanced edit mechanism, with "element picking" possibility

This commit is contained in:
Hombre
2016-03-03 00:25:10 +01:00
parent 98dd99103d
commit 06c26ff1b3
11 changed files with 706 additions and 288 deletions

View File

@@ -323,7 +323,7 @@ void Gradient::editToggled ()
}
}
CursorShape Gradient::getCursor(int objectID)
CursorShape Gradient::getCursor(const int objectID)
{
switch (objectID) {
case (0):
@@ -349,7 +349,7 @@ CursorShape Gradient::getCursor(int objectID)
}
}
bool Gradient::mouseOver(int modifierKey)
bool Gradient::mouseOver(const int modifierKey)
{
EditDataProvider* editProvider = getEditProvider();
@@ -379,7 +379,7 @@ bool Gradient::mouseOver(int modifierKey)
return false;
}
bool Gradient::button1Pressed(int modifierKey)
bool Gradient::button1Pressed(const int modifierKey)
{
if (lastObject < 0) {
return false;
@@ -433,7 +433,7 @@ bool Gradient::button1Pressed(int modifierKey)
draggedFeatherOffset -= (feather->getValue() / 200. * diagonal);
}
EditSubscriber::dragging = true;
EditSubscriber::action = ES_ACTION_DRAGGING;
return false;
} else { // should theoretically always be true
// this will let this class ignore further drag events
@@ -454,11 +454,11 @@ bool Gradient::button1Pressed(int modifierKey)
bool Gradient::button1Released()
{
draggedPointOldAngle = -1000.;
EditSubscriber::dragging = false;
EditSubscriber::action = ES_ACTION_NONE;
return true;
}
bool Gradient::drag1(int modifierKey)
bool Gradient::drag1(const int modifierKey)
{
// compute the polar coordinate of the mouse position
EditDataProvider *provider = getEditProvider();