Skip to content

Commit

Permalink
Changed OnSelect reticle behaviour to not update the cursor position …
Browse files Browse the repository at this point in the history
…when a position outside the image is selected. A right-click or cursor-move (shift dir-key) will make the reticle visible again.
  • Loading branch information
bluescan committed Sep 10, 2024
1 parent e43daea commit cb6796f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Src/TacentView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3144,16 +3144,24 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
if ((CursorMouseX >= 0.0f) && (CursorMouseX >= 0.0f))
{
tVector2 scrCursorPos(CursorMouseX, CursorMouseY);
int preClampCursorX = CursorX;
int preClampCursorY = CursorY;
bool clamped = ConvertScreenPosToImagePos(CursorX, CursorY, scrCursorPos, tVector4(left, right, top, bottom), tVector2(uoff, voff));
CursorMouseX = -1.0f; CursorMouseY = -1.0f;
ReticleVisibleOnSelect = !clamped;
if (clamped)
{
CursorX = preClampCursorX;
CursorY = preClampCursorY;
}
}

// If a request was made to move the cursor/reticle, process the request here,
if (RequestCursorMove)
{
if (!CropMode)
{
ReticleVisibleOnSelect = true;
switch (RequestCursorMove)
{
case CursorMove_Left: CursorX--; break;
Expand Down Expand Up @@ -3961,6 +3969,7 @@ void Viewer::MouseButtonCallback(GLFWwindow* window, int mouseButton, int press,
PanOffsetY += PanDragDownOffsetY;
PanDragDownOffsetX = 0;
PanDragDownOffsetY = 0;
ReticleVisibleOnSelect = true;
}
break;
}
Expand Down

0 comments on commit cb6796f

Please sign in to comment.