Issue 2025: crop box can now be grabbed in the corners
This commit is contained in:
parent
540fa3e005
commit
a72a8811ec
300
rtgui/crop.cc
300
rtgui/crop.cc
@ -741,158 +741,194 @@ void Crop::cropMoved (int &X, int &Y, int &W, int &H) {
|
|||||||
|
|
||||||
void Crop::cropWidth1Resized (int &X, int &Y, int &W, int &H) {
|
void Crop::cropWidth1Resized (int &X, int &Y, int &W, int &H) {
|
||||||
|
|
||||||
if (W<0)
|
int oldXR = nx + nw;
|
||||||
W = 0;
|
if (W < 0) W = 0;
|
||||||
if (H<0)
|
if (W > oldXR) W = oldXR;
|
||||||
H = 0;
|
if (fixr->get_active()) {
|
||||||
|
double r = getRatio();
|
||||||
if (X<0) {
|
H = (int)round(W / r);
|
||||||
W += X;
|
if (H > maxh) {
|
||||||
X = 0;
|
H = maxh;
|
||||||
}
|
W = H * r;
|
||||||
if (fixr->get_active()) {
|
}
|
||||||
double r = getRatio();
|
ny = ny - (H - nh) / 2.0;
|
||||||
int W2max = min(maxw, (int)round(r*maxh));
|
if (ny < 0) ny = 0;
|
||||||
if (W>W2max) {
|
if (ny + H > maxh) ny = maxh - H;
|
||||||
X += W - W2max;
|
|
||||||
W = W2max;
|
|
||||||
}
|
}
|
||||||
int oldH = H;
|
X = oldXR - W;
|
||||||
H = (int)round(W / r);
|
Y = ny;
|
||||||
Y = Y - (H - oldH) / 2;
|
nx = X;
|
||||||
if (X + W > maxw)
|
nw = W;
|
||||||
X = maxw - W;
|
nh = H;
|
||||||
if (Y + H > maxh)
|
|
||||||
Y = maxh - H;
|
|
||||||
else if (Y < 0)
|
|
||||||
Y = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
nx = X;
|
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
||||||
ny = Y;
|
|
||||||
nw = W;
|
|
||||||
nh = H;
|
|
||||||
|
|
||||||
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
|
||||||
// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropWidth2Resized (int &X, int &Y, int &W, int &H) {
|
void Crop::cropWidth2Resized (int &X, int &Y, int &W, int &H) {
|
||||||
|
|
||||||
// X = x->get_value ();
|
if (W < 0) W = 0;
|
||||||
// Y = y->get_value ();
|
if (W > maxw - nx) W = maxw - nx;
|
||||||
X = nx;
|
if (fixr->get_active()) {
|
||||||
Y = ny;
|
double r = getRatio();
|
||||||
|
H = (int)round(W / r);
|
||||||
|
if (H > maxh) {
|
||||||
|
H = maxh;
|
||||||
|
W = H * r;
|
||||||
|
}
|
||||||
|
ny = ny - (H - nh) / 2.0;
|
||||||
|
if (ny < 0) ny = 0;
|
||||||
|
if (ny + H > maxh) ny = maxh - H;
|
||||||
|
}
|
||||||
|
X = nx;
|
||||||
|
Y = ny;
|
||||||
|
nw = W;
|
||||||
|
nh = H;
|
||||||
|
|
||||||
if (W<0)
|
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
||||||
W = 0;
|
|
||||||
if (H<0)
|
|
||||||
H = 0;
|
|
||||||
|
|
||||||
if (W>maxw-X)
|
|
||||||
W = maxw-X;
|
|
||||||
|
|
||||||
if (fixr->get_active()) {
|
|
||||||
double r = getRatio();
|
|
||||||
int W2max = min(maxw, (int)round(r*maxh));
|
|
||||||
if (W>W2max)
|
|
||||||
W = W2max;
|
|
||||||
int oldH = H;
|
|
||||||
H = (int)round(W / r);
|
|
||||||
Y = Y - (H - oldH) / 2;
|
|
||||||
if (X + W > maxw)
|
|
||||||
X = maxw - W;
|
|
||||||
if (Y + H > maxh)
|
|
||||||
Y = maxh - H;
|
|
||||||
else if (Y < 0)
|
|
||||||
Y = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
nx = X;
|
|
||||||
ny = Y;
|
|
||||||
nw = W;
|
|
||||||
nh = H;
|
|
||||||
|
|
||||||
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
|
||||||
// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropHeight1Resized (int &X, int &Y, int &W, int &H) {
|
void Crop::cropHeight1Resized (int &X, int &Y, int &W, int &H) {
|
||||||
|
|
||||||
if (W<0)
|
int oldYB = ny + nh;
|
||||||
W = 0;
|
if (H < 0) H = 0;
|
||||||
if (H<0)
|
if (H > oldYB) H = oldYB;
|
||||||
H = 0;
|
if (fixr->get_active()) {
|
||||||
|
double r = getRatio();
|
||||||
if (Y<0) {
|
W = (int)round(H * r);
|
||||||
H += Y;
|
if (W > maxw) {
|
||||||
Y = 0;
|
W = maxw;
|
||||||
}
|
H = W / r;
|
||||||
|
}
|
||||||
if (fixr->get_active()) {
|
nx = nx - (W - nw) / 2.0;
|
||||||
double r = getRatio();
|
if (nx < 0) nx = 0;
|
||||||
int H2max = min(maxh, (int)round(maxw / r));
|
if (nx + W > maxw) nx = maxw - W;
|
||||||
if (H>H2max) {
|
|
||||||
Y += H - H2max;
|
|
||||||
H = H2max;
|
|
||||||
}
|
}
|
||||||
int oldW = W;
|
X = nx;
|
||||||
W = (int)round(H * r);
|
Y = oldYB - H;
|
||||||
X = X - (W - oldW) / 2;
|
ny = Y;
|
||||||
if (X + W > maxw)
|
nw = W;
|
||||||
X = maxw - W;
|
nh = H;
|
||||||
else if (X < 0)
|
|
||||||
X = 0;
|
|
||||||
if (Y + H > maxh)
|
|
||||||
Y = maxh - H;
|
|
||||||
}
|
|
||||||
|
|
||||||
nx = X;
|
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
||||||
ny = Y;
|
|
||||||
nw = W;
|
|
||||||
nh = H;
|
|
||||||
|
|
||||||
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
|
||||||
// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropHeight2Resized (int &X, int &Y, int &W, int &H) {
|
void Crop::cropHeight2Resized (int &X, int &Y, int &W, int &H) {
|
||||||
|
|
||||||
// X = x->get_value ();
|
if (H < 0) H = 0;
|
||||||
// Y = y->get_value ();
|
if (H > maxh - ny) H = maxh - ny;
|
||||||
X = nx;
|
if (fixr->get_active()) {
|
||||||
Y = ny;
|
double r = getRatio();
|
||||||
|
W = (int)round(H * r);
|
||||||
|
if (W > maxw) {
|
||||||
|
W = maxw;
|
||||||
|
H = W / r;
|
||||||
|
}
|
||||||
|
nx = nx - (W - nw) / 2.0; // nx must be floating point to avoid drifting
|
||||||
|
if (nx < 0) nx = 0;
|
||||||
|
if (nx + W > maxw) nx = maxw - W;
|
||||||
|
}
|
||||||
|
X = nx;
|
||||||
|
Y = ny;
|
||||||
|
nw = W;
|
||||||
|
nh = H;
|
||||||
|
|
||||||
if (W<0)
|
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
||||||
W = 0;
|
}
|
||||||
if (H<0)
|
|
||||||
H = 0;
|
|
||||||
int H1max = maxh-Y;
|
|
||||||
if (H>H1max)
|
|
||||||
H = H1max;
|
|
||||||
if (fixr->get_active()) {
|
|
||||||
double r = getRatio ();
|
|
||||||
int H2max = min(maxh, (int)round (maxw / r));
|
|
||||||
if (H>H2max)
|
|
||||||
H = H2max;
|
|
||||||
int oldW = W;
|
|
||||||
W = (int)round(H * r);
|
|
||||||
X = X - (W - oldW) / 2;
|
|
||||||
if (X + W > maxw)
|
|
||||||
X = maxw - W;
|
|
||||||
else if (X < 0)
|
|
||||||
X = 0;
|
|
||||||
if (Y + H > maxh)
|
|
||||||
Y = maxh - H;
|
|
||||||
}
|
|
||||||
|
|
||||||
nx = X;
|
void Crop::cropTopLeftResized (int &X, int &Y, int &W, int &H) {
|
||||||
ny = Y;
|
|
||||||
nw = W;
|
|
||||||
nh = H;
|
|
||||||
|
|
||||||
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
int oldXR = nx + nw; // right side
|
||||||
// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins));
|
int oldYB = ny + nh; // bottom side
|
||||||
|
if (W < 0) W = 0;
|
||||||
|
if (H < 0) H = 0;
|
||||||
|
if (W > oldXR) W = oldXR;
|
||||||
|
if (H > oldYB) H = oldYB;
|
||||||
|
if (fixr->get_active()) {
|
||||||
|
double r = getRatio();
|
||||||
|
W = (int)round(H * r);
|
||||||
|
if (W > oldXR) {
|
||||||
|
W = oldXR;
|
||||||
|
H = (int)round(W / r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
X = oldXR - W;
|
||||||
|
Y = oldYB - H;
|
||||||
|
nx = X;
|
||||||
|
ny = Y;
|
||||||
|
nw = W;
|
||||||
|
nh = H;
|
||||||
|
|
||||||
|
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Crop::cropTopRightResized (int &X, int &Y, int &W, int &H) {
|
||||||
|
|
||||||
|
int oldYB = ny + nh;
|
||||||
|
if (W < 0) W = 0;
|
||||||
|
if (H < 0) H = 0;
|
||||||
|
if (W > maxw - nx) W = maxw - nx;
|
||||||
|
if (H > oldYB) H = oldYB;
|
||||||
|
if (fixr->get_active()) {
|
||||||
|
double r = getRatio();
|
||||||
|
W = (int)round(H * r);
|
||||||
|
if (W > maxw - nx) {
|
||||||
|
W = maxw - nx;
|
||||||
|
H = (int)round(W / r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
X = nx;
|
||||||
|
Y = oldYB - H;
|
||||||
|
ny = Y;
|
||||||
|
nw = W;
|
||||||
|
nh = H;
|
||||||
|
|
||||||
|
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Crop::cropBottomLeftResized (int &X, int &Y, int &W, int &H) {
|
||||||
|
|
||||||
|
int oldXR = nx + nw;
|
||||||
|
if (W < 0) W = 0;
|
||||||
|
if (H < 0) H = 0;
|
||||||
|
if (W > oldXR) W = oldXR;
|
||||||
|
if (H > maxh - ny) H = maxh - ny;
|
||||||
|
if (fixr->get_active()) {
|
||||||
|
double r = getRatio();
|
||||||
|
W = (int)round(H * r);
|
||||||
|
if (W > oldXR) {
|
||||||
|
W = oldXR;
|
||||||
|
H = (int)round(W / r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
X = oldXR - W;
|
||||||
|
Y = ny;
|
||||||
|
nx = X;
|
||||||
|
nw = W;
|
||||||
|
nh = H;
|
||||||
|
|
||||||
|
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Crop::cropBottomRightResized (int &X, int &Y, int &W, int &H) {
|
||||||
|
|
||||||
|
if (W < 0) W = 0;
|
||||||
|
if (H < 0) H = 0;
|
||||||
|
if (W > maxw - nx) W = maxw - nx;
|
||||||
|
if (H > maxh - ny) H = maxh - ny;
|
||||||
|
if (fixr->get_active()) {
|
||||||
|
double r = getRatio();
|
||||||
|
W = (int)round(H * r);
|
||||||
|
if (W > maxw - nx) {
|
||||||
|
W = maxw - nx;
|
||||||
|
H = (int)round(W / r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
X = nx;
|
||||||
|
Y = ny;
|
||||||
|
nw = W;
|
||||||
|
nh = H;
|
||||||
|
|
||||||
|
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropInit (int &x, int &y, int &w, int &h) {
|
void Crop::cropInit (int &x, int &y, int &w, int &h) {
|
||||||
|
@ -59,7 +59,8 @@ class Crop : public Gtk::VBox, public CropGUIListener, public FoldableToolPanel,
|
|||||||
Gtk::VBox* ppibox;
|
Gtk::VBox* ppibox;
|
||||||
Gtk::VBox* sizebox;
|
Gtk::VBox* sizebox;
|
||||||
int maxw, maxh;
|
int maxw, maxh;
|
||||||
int nx, ny, nw, nh;
|
double nx, ny;
|
||||||
|
int nw, nh;
|
||||||
int lastRotationDeg;
|
int lastRotationDeg;
|
||||||
sigc::connection xconn, yconn, wconn, hconn, econn, fconn, rconn, oconn, gconn;
|
sigc::connection xconn, yconn, wconn, hconn, econn, fconn, rconn, oconn, gconn;
|
||||||
bool wDirty, hDirty, xDirty, yDirty, lastEnabled, lastFixRatio;
|
bool wDirty, hDirty, xDirty, yDirty, lastEnabled, lastFixRatio;
|
||||||
@ -96,6 +97,10 @@ class Crop : public Gtk::VBox, public CropGUIListener, public FoldableToolPanel,
|
|||||||
void cropWidth2Resized (int &x, int &y, int &w, int &h);
|
void cropWidth2Resized (int &x, int &y, int &w, int &h);
|
||||||
void cropHeight1Resized (int &x, int &y, int &w, int &h);
|
void cropHeight1Resized (int &x, int &y, int &w, int &h);
|
||||||
void cropHeight2Resized (int &x, int &y, int &w, int &h);
|
void cropHeight2Resized (int &x, int &y, int &w, int &h);
|
||||||
|
void cropTopLeftResized (int &x, int &y, int &w, int &h);
|
||||||
|
void cropTopRightResized (int &x, int &y, int &w, int &h);
|
||||||
|
void cropBottomLeftResized (int &x, int &y, int &w, int &h);
|
||||||
|
void cropBottomRightResized (int &x, int &y, int &w, int &h);
|
||||||
void cropInit (int &x, int &y, int &w, int &h);
|
void cropInit (int &x, int &y, int &w, int &h);
|
||||||
void cropResized (int &x, int &y, int& x2, int& y2);
|
void cropResized (int &x, int &y, int& x2, int& y2);
|
||||||
void cropManipReady ();
|
void cropManipReady ();
|
||||||
|
@ -27,6 +27,10 @@ class CropGUIListener {
|
|||||||
virtual void cropWidth2Resized (int &x, int &y, int &w, int &h) =0;
|
virtual void cropWidth2Resized (int &x, int &y, int &w, int &h) =0;
|
||||||
virtual void cropHeight1Resized (int &x, int &y, int &w, int &h) =0;
|
virtual void cropHeight1Resized (int &x, int &y, int &w, int &h) =0;
|
||||||
virtual void cropHeight2Resized (int &x, int &y, int &w, int &h) =0;
|
virtual void cropHeight2Resized (int &x, int &y, int &w, int &h) =0;
|
||||||
|
virtual void cropTopLeftResized (int &x, int &y, int &w, int &h) =0;
|
||||||
|
virtual void cropTopRightResized (int &x, int &y, int &w, int &h) =0;
|
||||||
|
virtual void cropBottomLeftResized (int &x, int &y, int &w, int &h) =0;
|
||||||
|
virtual void cropBottomRightResized (int &x, int &y, int &w, int &h) =0;
|
||||||
virtual void cropInit (int &x, int &y, int &w, int &h) =0;
|
virtual void cropInit (int &x, int &y, int &w, int &h) =0;
|
||||||
virtual void cropResized (int &x, int &y, int& x2, int& y2) =0;
|
virtual void cropResized (int &x, int &y, int& x2, int& y2) =0;
|
||||||
virtual void cropManipReady () =0;
|
virtual void cropManipReady () =0;
|
||||||
|
@ -266,7 +266,35 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y) {
|
|||||||
press_y = height;
|
press_y = height;
|
||||||
}
|
}
|
||||||
else if (button==1 && type==GDK_BUTTON_PRESS && state==SNormal && onArea (CropImage, x, y)) {
|
else if (button==1 && type==GDK_BUTTON_PRESS && state==SNormal && onArea (CropImage, x, y)) {
|
||||||
if (onArea (CropTop, x, y)) {
|
if (onArea (CropTopLeft, x, y)) {
|
||||||
|
state = SResizeTL;
|
||||||
|
press_x = x;
|
||||||
|
action_x = cropHandler.cropParams.x;
|
||||||
|
press_y = y;
|
||||||
|
action_y = cropHandler.cropParams.y;
|
||||||
|
}
|
||||||
|
else if (onArea (CropTopRight, x, y)) {
|
||||||
|
state = SResizeTR;
|
||||||
|
press_x = x;
|
||||||
|
action_x = cropHandler.cropParams.w;
|
||||||
|
press_y = y;
|
||||||
|
action_y = cropHandler.cropParams.y;
|
||||||
|
}
|
||||||
|
else if (onArea (CropBottomLeft, x, y)) {
|
||||||
|
state = SResizeBL;
|
||||||
|
press_x = x;
|
||||||
|
action_x = cropHandler.cropParams.x;
|
||||||
|
press_y = y;
|
||||||
|
action_y = cropHandler.cropParams.h;
|
||||||
|
}
|
||||||
|
else if (onArea (CropBottomRight, x, y)) {
|
||||||
|
state = SResizeBR;
|
||||||
|
press_x = x;
|
||||||
|
action_x = cropHandler.cropParams.w;
|
||||||
|
press_y = y;
|
||||||
|
action_y = cropHandler.cropParams.h;
|
||||||
|
}
|
||||||
|
else if (onArea (CropTop, x, y)) {
|
||||||
state = SResizeH1;
|
state = SResizeH1;
|
||||||
press_y = y;
|
press_y = y;
|
||||||
action_y = cropHandler.cropParams.y;
|
action_y = cropHandler.cropParams.y;
|
||||||
@ -364,7 +392,8 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y) {
|
|||||||
observedCropWin->remoteMoveReady ();
|
observedCropWin->remoteMoveReady ();
|
||||||
state = SNormal;
|
state = SNormal;
|
||||||
}
|
}
|
||||||
if (cropgl && (state==SCropSelecting || state==SResizeH1 || state==SResizeH2 || state==SResizeW1 || state==SResizeW2 || state==SCropMove)) {
|
if (cropgl && (state==SCropSelecting || state==SResizeH1 || state==SResizeH2 || state==SResizeW1 || state==SResizeW2 || state==SResizeTL || state==SResizeTR || state==SResizeBL || state==SResizeBR || state==SCropMove))
|
||||||
|
{
|
||||||
cropgl->cropManipReady ();
|
cropgl->cropManipReady ();
|
||||||
iarea->setToolHand ();
|
iarea->setToolHand ();
|
||||||
}
|
}
|
||||||
@ -438,6 +467,38 @@ void CropWindow::pointerMoved (int x, int y) {
|
|||||||
cropgl->cropWidth2Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h);
|
cropgl->cropWidth2Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h);
|
||||||
iarea->redraw ();
|
iarea->redraw ();
|
||||||
}
|
}
|
||||||
|
else if (state==SResizeTL && cropgl) {
|
||||||
|
int ox = cropHandler.cropParams.x;
|
||||||
|
cropHandler.cropParams.x = action_x + (x-press_x) / zoomSteps[cropZoom].zoom;
|
||||||
|
cropHandler.cropParams.w += ox - cropHandler.cropParams.x;
|
||||||
|
int oy = cropHandler.cropParams.y;
|
||||||
|
cropHandler.cropParams.y = action_y + (y-press_y) / zoomSteps[cropZoom].zoom;
|
||||||
|
cropHandler.cropParams.h += oy - cropHandler.cropParams.y;
|
||||||
|
cropgl->cropTopLeftResized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h);
|
||||||
|
iarea->redraw ();
|
||||||
|
}
|
||||||
|
else if (state==SResizeTR && cropgl) {
|
||||||
|
cropHandler.cropParams.w = action_x + (x-press_x) / zoomSteps[cropZoom].zoom;
|
||||||
|
int oy = cropHandler.cropParams.y;
|
||||||
|
cropHandler.cropParams.y = action_y + (y-press_y) / zoomSteps[cropZoom].zoom;
|
||||||
|
cropHandler.cropParams.h += oy - cropHandler.cropParams.y;
|
||||||
|
cropgl->cropTopRightResized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h);
|
||||||
|
iarea->redraw ();
|
||||||
|
}
|
||||||
|
else if (state==SResizeBL && cropgl) {
|
||||||
|
int ox = cropHandler.cropParams.x;
|
||||||
|
cropHandler.cropParams.x = action_x + (x-press_x) / zoomSteps[cropZoom].zoom;
|
||||||
|
cropHandler.cropParams.w += ox - cropHandler.cropParams.x;
|
||||||
|
cropHandler.cropParams.h = action_y + (y-press_y) / zoomSteps[cropZoom].zoom;
|
||||||
|
cropgl->cropBottomLeftResized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h);
|
||||||
|
iarea->redraw ();
|
||||||
|
}
|
||||||
|
else if (state==SResizeBR && cropgl) {
|
||||||
|
cropHandler.cropParams.w = action_x + (x-press_x) / zoomSteps[cropZoom].zoom;
|
||||||
|
cropHandler.cropParams.h = action_y + (y-press_y) / zoomSteps[cropZoom].zoom;
|
||||||
|
cropgl->cropBottomRightResized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h);
|
||||||
|
iarea->redraw ();
|
||||||
|
}
|
||||||
else if (state==SCropMove && cropgl) {
|
else if (state==SCropMove && cropgl) {
|
||||||
cropHandler.cropParams.x = action_x + (x-press_x) / zoomSteps[cropZoom].zoom;
|
cropHandler.cropParams.x = action_x + (x-press_x) / zoomSteps[cropZoom].zoom;
|
||||||
cropHandler.cropParams.y = action_y + (y-press_y) / zoomSteps[cropZoom].zoom;
|
cropHandler.cropParams.y = action_y + (y-press_y) / zoomSteps[cropZoom].zoom;
|
||||||
@ -537,6 +598,42 @@ bool CropWindow::onArea (CursorArea a, int x, int y) {
|
|||||||
return
|
return
|
||||||
(x>=xpos+imgAreaX && y>=ypos+imgAreaY && x<xpos+imgAreaX+imgAreaW && y<ypos+imgAreaY+imgAreaH) &&
|
(x>=xpos+imgAreaX && y>=ypos+imgAreaY && x<xpos+imgAreaX+imgAreaW && y<ypos+imgAreaY+imgAreaH) &&
|
||||||
!(x>=xpos+imgX && y>=ypos+imgY && x<xpos+imgX+imgW && y<ypos+imgY+imgH);
|
!(x>=xpos+imgX && y>=ypos+imgY && x<xpos+imgX+imgW && y<ypos+imgY+imgH);
|
||||||
|
case CropTopLeft:
|
||||||
|
translateCoord (x, y, x1, y1);
|
||||||
|
return cropHandler.cropParams.enabled &&
|
||||||
|
y1>=cropHandler.cropParams.y-CROPRESIZEBORDER &&
|
||||||
|
y1<=cropHandler.cropParams.y+CROPRESIZEBORDER &&
|
||||||
|
y>=ypos+imgY &&
|
||||||
|
x1>=cropHandler.cropParams.x-CROPRESIZEBORDER &&
|
||||||
|
x1<=cropHandler.cropParams.x+CROPRESIZEBORDER &&
|
||||||
|
x>=xpos+imgX;
|
||||||
|
case CropTopRight:
|
||||||
|
translateCoord (x, y, x1, y1);
|
||||||
|
return cropHandler.cropParams.enabled &&
|
||||||
|
y1>=cropHandler.cropParams.y-CROPRESIZEBORDER &&
|
||||||
|
y1<=cropHandler.cropParams.y+CROPRESIZEBORDER &&
|
||||||
|
y>=ypos+imgY &&
|
||||||
|
x1>=cropHandler.cropParams.x+cropHandler.cropParams.w-1-CROPRESIZEBORDER &&
|
||||||
|
x1<=cropHandler.cropParams.x+cropHandler.cropParams.w-1+CROPRESIZEBORDER &&
|
||||||
|
x<xpos+imgX+imgW;
|
||||||
|
case CropBottomLeft:
|
||||||
|
translateCoord (x, y, x1, y1);
|
||||||
|
return cropHandler.cropParams.enabled &&
|
||||||
|
y1>=cropHandler.cropParams.y+cropHandler.cropParams.h-1-CROPRESIZEBORDER &&
|
||||||
|
y1<=cropHandler.cropParams.y+cropHandler.cropParams.h-1+CROPRESIZEBORDER &&
|
||||||
|
y<ypos+imgY+imgH &&
|
||||||
|
x1>=cropHandler.cropParams.x-CROPRESIZEBORDER &&
|
||||||
|
x1<=cropHandler.cropParams.x+CROPRESIZEBORDER &&
|
||||||
|
x>=xpos+imgX;
|
||||||
|
case CropBottomRight:
|
||||||
|
translateCoord (x, y, x1, y1);
|
||||||
|
return cropHandler.cropParams.enabled &&
|
||||||
|
y1>=cropHandler.cropParams.y+cropHandler.cropParams.h-1-CROPRESIZEBORDER &&
|
||||||
|
y1<=cropHandler.cropParams.y+cropHandler.cropParams.h-1+CROPRESIZEBORDER &&
|
||||||
|
y<ypos+imgY+imgH &&
|
||||||
|
x1>=cropHandler.cropParams.x+cropHandler.cropParams.w-1-CROPRESIZEBORDER &&
|
||||||
|
x1<=cropHandler.cropParams.x+cropHandler.cropParams.w-1+CROPRESIZEBORDER &&
|
||||||
|
x<xpos+imgX+imgW;
|
||||||
case CropTop:
|
case CropTop:
|
||||||
translateCoord (x, y, x1, y1);
|
translateCoord (x, y, x1, y1);
|
||||||
return cropHandler.cropParams.enabled &&
|
return cropHandler.cropParams.enabled &&
|
||||||
@ -599,6 +696,14 @@ void CropWindow::updateCursor (int x, int y) {
|
|||||||
cursorManager.setCursor (iarea->get_window(), CSMove);
|
cursorManager.setCursor (iarea->get_window(), CSMove);
|
||||||
else if (onArea (CropResize, x, y))
|
else if (onArea (CropResize, x, y))
|
||||||
cursorManager.setCursor (iarea->get_window(), CSResizeDiagonal);
|
cursorManager.setCursor (iarea->get_window(), CSResizeDiagonal);
|
||||||
|
else if (tm==TMHand && (onArea (CropTopLeft, x, y)))
|
||||||
|
cursorManager.setCursor (iarea->get_window(), CSResizeTopLeft);
|
||||||
|
else if (tm==TMHand && (onArea (CropTopRight, x, y)))
|
||||||
|
cursorManager.setCursor (iarea->get_window(), CSResizeTopRight);
|
||||||
|
else if (tm==TMHand && (onArea (CropBottomLeft, x, y)))
|
||||||
|
cursorManager.setCursor (iarea->get_window(), CSResizeBottomLeft);
|
||||||
|
else if (tm==TMHand && (onArea (CropBottomRight, x, y)))
|
||||||
|
cursorManager.setCursor (iarea->get_window(), CSResizeBottomRight);
|
||||||
else if (tm==TMHand && (onArea (CropTop, x, y) || onArea (CropBottom, x, y)))
|
else if (tm==TMHand && (onArea (CropTop, x, y) || onArea (CropBottom, x, y)))
|
||||||
cursorManager.setCursor (iarea->get_window(), CSResizeHeight);
|
cursorManager.setCursor (iarea->get_window(), CSResizeHeight);
|
||||||
else if (tm==TMHand && (onArea (CropLeft, x, y) || onArea (CropRight, x, y)))
|
else if (tm==TMHand && (onArea (CropLeft, x, y) || onArea (CropRight, x, y)))
|
||||||
@ -632,6 +737,14 @@ void CropWindow::updateCursor (int x, int y) {
|
|||||||
cursorManager.setCursor (iarea->get_window(), CSResizeWidth);
|
cursorManager.setCursor (iarea->get_window(), CSResizeWidth);
|
||||||
else if (state==SResizeH1 || state==SResizeH2)
|
else if (state==SResizeH1 || state==SResizeH2)
|
||||||
cursorManager.setCursor (iarea->get_window(), CSResizeHeight);
|
cursorManager.setCursor (iarea->get_window(), CSResizeHeight);
|
||||||
|
else if (state==SResizeTL)
|
||||||
|
cursorManager.setCursor (iarea->get_window(), CSResizeTopLeft);
|
||||||
|
else if (state==SResizeTR)
|
||||||
|
cursorManager.setCursor (iarea->get_window(), CSResizeTopRight);
|
||||||
|
else if (state==SResizeBL)
|
||||||
|
cursorManager.setCursor (iarea->get_window(), CSResizeBottomLeft);
|
||||||
|
else if (state==SResizeBR)
|
||||||
|
cursorManager.setCursor (iarea->get_window(), CSResizeBottomRight);
|
||||||
else if (state==SCropWinResize)
|
else if (state==SCropWinResize)
|
||||||
cursorManager.setCursor (iarea->get_window(), CSResizeDiagonal);
|
cursorManager.setCursor (iarea->get_window(), CSResizeDiagonal);
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,10 @@ void CursorManager::init (Glib::RefPtr<Gdk::Window> mainWin) {
|
|||||||
cResizeWidth = new Gdk::Cursor (Gdk::SB_H_DOUBLE_ARROW);
|
cResizeWidth = new Gdk::Cursor (Gdk::SB_H_DOUBLE_ARROW);
|
||||||
cResizeHeight = new Gdk::Cursor (Gdk::SB_V_DOUBLE_ARROW);
|
cResizeHeight = new Gdk::Cursor (Gdk::SB_V_DOUBLE_ARROW);
|
||||||
cResizeDiag = new Gdk::Cursor (Gdk::BOTTOM_RIGHT_CORNER);
|
cResizeDiag = new Gdk::Cursor (Gdk::BOTTOM_RIGHT_CORNER);
|
||||||
|
cResizeTopLeft = new Gdk::Cursor (Gdk::TOP_LEFT_CORNER);
|
||||||
|
cResizeTopRight = new Gdk::Cursor (Gdk::TOP_RIGHT_CORNER);
|
||||||
|
cResizeBottomLeft = new Gdk::Cursor (Gdk::BOTTOM_LEFT_CORNER);
|
||||||
|
cResizeBottomRight = new Gdk::Cursor (Gdk::BOTTOM_RIGHT_CORNER);
|
||||||
cCropMove = new Gdk::Cursor (Gdk::FLEUR);
|
cCropMove = new Gdk::Cursor (Gdk::FLEUR);
|
||||||
cCropMoving = new Gdk::Cursor (Gdk::HAND2);
|
cCropMoving = new Gdk::Cursor (Gdk::HAND2);
|
||||||
cCropSelection = new Gdk::Cursor (Gdk::CROSSHAIR);
|
cCropSelection = new Gdk::Cursor (Gdk::CROSSHAIR);
|
||||||
@ -67,6 +71,14 @@ void CursorManager::setCursor (Glib::RefPtr<Gdk::Window> window, CursorShape sha
|
|||||||
window->set_cursor (*cResizeHeight);
|
window->set_cursor (*cResizeHeight);
|
||||||
else if (shape==CSResizeDiagonal)
|
else if (shape==CSResizeDiagonal)
|
||||||
window->set_cursor (*cResizeDiag);
|
window->set_cursor (*cResizeDiag);
|
||||||
|
else if (shape==CSResizeTopLeft)
|
||||||
|
window->set_cursor (*cResizeTopLeft);
|
||||||
|
else if (shape==CSResizeTopRight)
|
||||||
|
window->set_cursor (*cResizeTopRight);
|
||||||
|
else if (shape==CSResizeBottomLeft)
|
||||||
|
window->set_cursor (*cResizeBottomLeft);
|
||||||
|
else if (shape==CSResizeBottomRight)
|
||||||
|
window->set_cursor (*cResizeBottomRight);
|
||||||
else if (shape==CSSpotWB)
|
else if (shape==CSSpotWB)
|
||||||
window->set_cursor (*cWB);
|
window->set_cursor (*cWB);
|
||||||
else if (shape==CSCropSelect)
|
else if (shape==CSCropSelect)
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <gtkmm.h>
|
#include <gtkmm.h>
|
||||||
|
|
||||||
enum CursorShape {CSArrow, CSOpenHand, CSClosedHand, CSMove, CSMoveLeft, CSMoveRight, CSResizeWidth, CSResizeHeight, CSResizeDiagonal, CSSpotWB, CSCropSelect, CSStraighten, CSPlus, CSWait, CSEmpty};
|
enum CursorShape {CSArrow, CSOpenHand, CSClosedHand, CSMove, CSMoveLeft, CSMoveRight, CSResizeWidth, CSResizeHeight, CSResizeDiagonal, CSResizeTopLeft, CSResizeTopRight, CSResizeBottomLeft, CSResizeBottomRight, CSSpotWB, CSCropSelect, CSStraighten, CSPlus, CSWait, CSEmpty};
|
||||||
|
|
||||||
class CursorManager {
|
class CursorManager {
|
||||||
|
|
||||||
@ -29,6 +29,10 @@ class CursorManager {
|
|||||||
Gdk::Cursor* cResizeWidth;
|
Gdk::Cursor* cResizeWidth;
|
||||||
Gdk::Cursor* cResizeHeight;
|
Gdk::Cursor* cResizeHeight;
|
||||||
Gdk::Cursor* cResizeDiag;
|
Gdk::Cursor* cResizeDiag;
|
||||||
|
Gdk::Cursor* cResizeTopLeft;
|
||||||
|
Gdk::Cursor* cResizeTopRight;
|
||||||
|
Gdk::Cursor* cResizeBottomLeft;
|
||||||
|
Gdk::Cursor* cResizeBottomRight;
|
||||||
Gdk::Cursor* cCropMove;
|
Gdk::Cursor* cCropMove;
|
||||||
Gdk::Cursor* cCropMoving;
|
Gdk::Cursor* cCropMoving;
|
||||||
Gdk::Cursor* cLeftTanMove;
|
Gdk::Cursor* cLeftTanMove;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#ifndef _EDITENUMS_
|
#ifndef _EDITENUMS_
|
||||||
#define _EDITENUMS_
|
#define _EDITENUMS_
|
||||||
|
|
||||||
enum ImgEditState {SNormal, SCropMove, SHandMove, SResizeW1, SResizeW2, SResizeH1, SResizeH2, SCropSelecting, SRotateSelecting, SCropWinMove, SCropFrameMove, SCropImgMove, SCropWinResize, SObservedMove};
|
enum ImgEditState {SNormal, SCropMove, SHandMove, SResizeW1, SResizeW2, SResizeH1, SResizeH2, SResizeTL, SResizeTR, SResizeBL, SResizeBR, SCropSelecting, SRotateSelecting, SCropWinMove, SCropFrameMove, SCropImgMove, SCropWinResize, SObservedMove};
|
||||||
enum CursorArea {CropWinButtons, CropToolBar, CropImage, CropBorder, CropTop, CropBottom, CropLeft, CropRight, CropInside, CropResize, CropObserved};
|
enum CursorArea {CropWinButtons, CropToolBar, CropImage, CropBorder, CropTop, CropTopLeft, CropTopRight, CropBottom, CropBottomLeft, CropBottomRight, CropLeft, CropRight, CropInside, CropResize, CropObserved};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -121,7 +121,7 @@ std::vector<Glib::RefPtr<Gdk::Pixbuf> > FileBrowserEntry::getIconsOnImageArea ()
|
|||||||
|
|
||||||
void FileBrowserEntry::customBackBufferUpdate (Cairo::RefPtr<Cairo::Context> c) {
|
void FileBrowserEntry::customBackBufferUpdate (Cairo::RefPtr<Cairo::Context> c) {
|
||||||
|
|
||||||
if (state==SCropSelecting || state==SResizeH1 || state==SResizeH2 || state==SResizeW1 || state==SResizeW2 || state==SCropMove)
|
if (state==SCropSelecting || state==SResizeH1 || state==SResizeH2 || state==SResizeW1 || state==SResizeW2 || state==SResizeTL || state==SResizeTR || state==SResizeBL || state==SResizeBR || state==SCropMove)
|
||||||
drawCrop (c, prex, prey, prew, preh, 0, 0, scale, cropParams);
|
drawCrop (c, prex, prey, prew, preh, 0, 0, scale, cropParams);
|
||||||
else {
|
else {
|
||||||
rtengine::procparams::CropParams cparams = thumbnail->getProcParams().crop;
|
rtengine::procparams::CropParams cparams = thumbnail->getProcParams().crop;
|
||||||
@ -292,6 +292,42 @@ bool FileBrowserEntry::motionNotify (int x, int y) {
|
|||||||
updateBackBuffer ();
|
updateBackBuffer ();
|
||||||
parent->redrawNeeded (this);
|
parent->redrawNeeded (this);
|
||||||
}
|
}
|
||||||
|
else if (state==SResizeTL && cropgl) {
|
||||||
|
int ox = cropParams.x;
|
||||||
|
cropParams.x = action_x + (x-press_x) / scale;
|
||||||
|
cropParams.w += ox - cropParams.x;
|
||||||
|
int oy = cropParams.y;
|
||||||
|
cropParams.y = action_y + (y-press_y) / scale;
|
||||||
|
cropParams.h += oy - cropParams.y;
|
||||||
|
cropgl->cropTopLeftResized (cropParams.x, cropParams.y, cropParams.w, cropParams.h);
|
||||||
|
updateBackBuffer ();
|
||||||
|
parent->redrawNeeded (this);
|
||||||
|
}
|
||||||
|
else if (state==SResizeTR && cropgl) {
|
||||||
|
cropParams.w = action_x + (x-press_x) / scale;
|
||||||
|
int oy = cropParams.y;
|
||||||
|
cropParams.y = action_y + (y-press_y) / scale;
|
||||||
|
cropParams.h += oy - cropParams.y;
|
||||||
|
cropgl->cropTopRightResized (cropParams.x, cropParams.y, cropParams.w, cropParams.h);
|
||||||
|
updateBackBuffer ();
|
||||||
|
parent->redrawNeeded (this);
|
||||||
|
}
|
||||||
|
else if (state==SResizeBL && cropgl) {
|
||||||
|
int ox = cropParams.x;
|
||||||
|
cropParams.x = action_x + (x-press_x) / scale;
|
||||||
|
cropParams.w += ox - cropParams.x;
|
||||||
|
cropParams.h = action_y + (y-press_y) / scale;
|
||||||
|
cropgl->cropBottomLeftResized (cropParams.x, cropParams.y, cropParams.w, cropParams.h);
|
||||||
|
updateBackBuffer ();
|
||||||
|
parent->redrawNeeded (this);
|
||||||
|
}
|
||||||
|
else if (state==SResizeBR && cropgl) {
|
||||||
|
cropParams.w = action_x + (x-press_x) / scale;
|
||||||
|
cropParams.h = action_y + (y-press_y) / scale;
|
||||||
|
cropgl->cropBottomRightResized (cropParams.x, cropParams.y, cropParams.w, cropParams.h);
|
||||||
|
updateBackBuffer ();
|
||||||
|
parent->redrawNeeded (this);
|
||||||
|
}
|
||||||
else if (state==SCropMove && cropgl) {
|
else if (state==SCropMove && cropgl) {
|
||||||
cropParams.x = action_x + (x-press_x) / scale;
|
cropParams.x = action_x + (x-press_x) / scale;
|
||||||
cropParams.y = action_y + (y-press_y) / scale;
|
cropParams.y = action_y + (y-press_y) / scale;
|
||||||
@ -338,7 +374,43 @@ bool FileBrowserEntry::pressNotify (int button, int type, int bstate, int x, i
|
|||||||
int iy = y - starty - ofsY;
|
int iy = y - starty - ofsY;
|
||||||
if (!b && selected && inside (x,y)) {
|
if (!b && selected && inside (x,y)) {
|
||||||
if (button==1 && type==GDK_BUTTON_PRESS && state==SNormal) {
|
if (button==1 && type==GDK_BUTTON_PRESS && state==SNormal) {
|
||||||
if (onArea (CropTop, ix, iy)) {
|
if (onArea (CropTopLeft, ix, iy)) {
|
||||||
|
state = SResizeTL;
|
||||||
|
press_x = x;
|
||||||
|
action_x = cropParams.x;
|
||||||
|
press_y = y;
|
||||||
|
action_y = cropParams.y;
|
||||||
|
cropgl = iatlistener->startCropEditing (thumbnail);
|
||||||
|
b = true;
|
||||||
|
}
|
||||||
|
else if (onArea (CropTopRight, ix, iy)) {
|
||||||
|
state = SResizeTR;
|
||||||
|
press_x = x;
|
||||||
|
action_x = cropParams.w;
|
||||||
|
press_y = y;
|
||||||
|
action_y = cropParams.y;
|
||||||
|
cropgl = iatlistener->startCropEditing (thumbnail);
|
||||||
|
b = true;
|
||||||
|
}
|
||||||
|
else if (onArea (CropBottomLeft, ix, iy)) {
|
||||||
|
state = SResizeBL;
|
||||||
|
press_x = x;
|
||||||
|
action_x = cropParams.x;
|
||||||
|
press_y = y;
|
||||||
|
action_y = cropParams.h;
|
||||||
|
cropgl = iatlistener->startCropEditing (thumbnail);
|
||||||
|
b = true;
|
||||||
|
}
|
||||||
|
else if (onArea (CropBottomRight, ix, iy)) {
|
||||||
|
state = SResizeBR;
|
||||||
|
press_x = x;
|
||||||
|
action_x = cropParams.w;
|
||||||
|
press_y = y;
|
||||||
|
action_y = cropParams.h;
|
||||||
|
cropgl = iatlistener->startCropEditing (thumbnail);
|
||||||
|
b = true;
|
||||||
|
}
|
||||||
|
else if (onArea (CropTop, ix, iy)) {
|
||||||
state = SResizeH1;
|
state = SResizeH1;
|
||||||
press_y = y;
|
press_y = y;
|
||||||
action_y = cropParams.y;
|
action_y = cropParams.y;
|
||||||
@ -418,7 +490,7 @@ bool FileBrowserEntry::releaseNotify (int button, int type, int bstate, int x, i
|
|||||||
iatlistener->rotateSelectionReady (rot_deg, thumbnail);
|
iatlistener->rotateSelectionReady (rot_deg, thumbnail);
|
||||||
if (iatlistener->getToolBar()) iatlistener->getToolBar()->setTool (TMHand);
|
if (iatlistener->getToolBar()) iatlistener->getToolBar()->setTool (TMHand);
|
||||||
}
|
}
|
||||||
else if (cropgl && (state==SCropSelecting || state==SResizeH1 || state==SResizeH2 || state==SResizeW1 || state==SResizeW2 || state==SCropMove)) {
|
else if (cropgl && (state==SCropSelecting || state==SResizeH1 || state==SResizeH2 || state==SResizeW1 || state==SResizeW2 || state==SResizeTL || state==SResizeTR || state==SResizeBL || state==SResizeBR || state==SCropMove)) {
|
||||||
cropgl->cropManipReady ();
|
cropgl->cropManipReady ();
|
||||||
cropgl = NULL;
|
cropgl = NULL;
|
||||||
iatlistener->cropSelectionReady ();
|
iatlistener->cropSelectionReady ();
|
||||||
@ -444,6 +516,30 @@ bool FileBrowserEntry::onArea (CursorArea a, int x, int y) {
|
|||||||
switch (a) {
|
switch (a) {
|
||||||
case CropImage:
|
case CropImage:
|
||||||
return x>=prex && x<prex+prew && y>=prey && y<prey+preh;
|
return x>=prex && x<prex+prew && y>=prey && y<prey+preh;
|
||||||
|
case CropTopLeft:
|
||||||
|
return cropParams.enabled &&
|
||||||
|
y1>=cropParams.y-cropResizeBorder &&
|
||||||
|
y1<=cropParams.y+cropResizeBorder &&
|
||||||
|
x1>=cropParams.x-cropResizeBorder &&
|
||||||
|
x1<=cropParams.x+cropResizeBorder;
|
||||||
|
case CropTopRight:
|
||||||
|
return cropParams.enabled &&
|
||||||
|
y1>=cropParams.y-cropResizeBorder &&
|
||||||
|
y1<=cropParams.y+cropResizeBorder &&
|
||||||
|
x1>=cropParams.x+cropParams.w-1-cropResizeBorder &&
|
||||||
|
x1<=cropParams.x+cropParams.w-1+cropResizeBorder;
|
||||||
|
case CropBottomLeft:
|
||||||
|
return cropParams.enabled &&
|
||||||
|
y1>=cropParams.y+cropParams.h-1-cropResizeBorder &&
|
||||||
|
y1<=cropParams.y+cropParams.h-1+cropResizeBorder &&
|
||||||
|
x1>=cropParams.x-cropResizeBorder &&
|
||||||
|
x1<=cropParams.x+cropResizeBorder;
|
||||||
|
case CropBottomRight:
|
||||||
|
return cropParams.enabled &&
|
||||||
|
y1>=cropParams.y+cropParams.h-1-cropResizeBorder &&
|
||||||
|
y1<=cropParams.y+cropParams.h-1+cropResizeBorder &&
|
||||||
|
x1>=cropParams.x+cropParams.w-1-cropResizeBorder &&
|
||||||
|
x1<=cropParams.x+cropParams.w-1+cropResizeBorder;
|
||||||
case CropTop:
|
case CropTop:
|
||||||
return cropParams.enabled &&
|
return cropParams.enabled &&
|
||||||
x1>cropParams.x+cropResizeBorder &&
|
x1>cropParams.x+cropResizeBorder &&
|
||||||
@ -497,6 +593,14 @@ void FileBrowserEntry::updateCursor (int x, int y) {
|
|||||||
cursorManager.setCursor (w, CSResizeHeight);
|
cursorManager.setCursor (w, CSResizeHeight);
|
||||||
else if (tm==TMHand && (onArea (CropLeft, x, y) || onArea (CropRight, x, y)))
|
else if (tm==TMHand && (onArea (CropLeft, x, y) || onArea (CropRight, x, y)))
|
||||||
cursorManager.setCursor (w, CSResizeWidth);
|
cursorManager.setCursor (w, CSResizeWidth);
|
||||||
|
else if (tm==TMHand && (onArea (CropTopLeft, x, y)))
|
||||||
|
cursorManager.setCursor (w, CSResizeTopLeft);
|
||||||
|
else if (tm==TMHand && (onArea (CropTopRight, x, y)))
|
||||||
|
cursorManager.setCursor (w, CSResizeTopRight);
|
||||||
|
else if (tm==TMHand && (onArea (CropBottomLeft, x, y)))
|
||||||
|
cursorManager.setCursor (w, CSResizeBottomLeft);
|
||||||
|
else if (tm==TMHand && (onArea (CropBottomRight, x, y)))
|
||||||
|
cursorManager.setCursor (w, CSResizeBottomRight);
|
||||||
else if (onArea (CropImage, x, y)) {
|
else if (onArea (CropImage, x, y)) {
|
||||||
if (tm==TMHand)
|
if (tm==TMHand)
|
||||||
cursorManager.setCursor (w, CSArrow);
|
cursorManager.setCursor (w, CSArrow);
|
||||||
@ -520,6 +624,14 @@ void FileBrowserEntry::updateCursor (int x, int y) {
|
|||||||
cursorManager.setCursor (w, CSResizeWidth);
|
cursorManager.setCursor (w, CSResizeWidth);
|
||||||
else if (state==SResizeH1 || state==SResizeH2)
|
else if (state==SResizeH1 || state==SResizeH2)
|
||||||
cursorManager.setCursor (w, CSResizeHeight);
|
cursorManager.setCursor (w, CSResizeHeight);
|
||||||
|
else if (state==SResizeTL)
|
||||||
|
cursorManager.setCursor (w, CSResizeTopLeft);
|
||||||
|
else if (state==SResizeTR)
|
||||||
|
cursorManager.setCursor (w, CSResizeTopRight);
|
||||||
|
else if (state==SResizeBL)
|
||||||
|
cursorManager.setCursor (w, CSResizeBottomLeft);
|
||||||
|
else if (state==SResizeBR)
|
||||||
|
cursorManager.setCursor (w, CSResizeBottomRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileBrowserEntry::draw () {
|
void FileBrowserEntry::draw () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user