GithubHelp home page GithubHelp logo

Comments (1)

snechaev avatar snechaev commented on July 19, 2024

I hit the same problem.
In my case the IsPanning is always true inside a click handler so it is impossible to distinguish between "click" and "drag to pan" actions.

A quick research shown that a problem was introduced into rev. 3aa026b (Added PanMode and AllowFreePan properties). In this revision the ProcessPanning is called directly from OnMouseDown handler (so, before the click event) and when click event happens, the pan is already started and IsPanning=true.

if (e.Button != MouseButtons.None)
{
if (_panStyle == ImageBoxPanStyle.Free)
{
// already panning, abort
this.ProcessPanEvents(ImageBoxPanStyle.None);
}
else
{
_mouseDownStart = NativeMethods.GetTickCount();
this.ProcessPanning(e);
}
}

It looks like this can be fixed just by adding additional checks for AllowFreePan and mouse button and then call ProcessPanning only if Free Pan is enabled and the button is middle button.

I will provide a pull request with the fix, but I'm unsure that such a fix will play good with all the features and modes of ImageBox.

from cyotek.windows.forms.imagebox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.