Giter VIP home page Giter VIP logo

Comments (7)

tannerhelland avatar tannerhelland commented on August 18, 2024

Further investigation into how other software handles this leaves me conflicted on changing the behavior. For reference, here are some notes from two other applications (and my common points of reference on such matters):

GIMP: clears coordinate box when mouse leaves viewport. Displays coordinates over the image in BLACK, coordinates over the viewport (but not the image) in GRAY.

Paint.NET: never clears coordinate box. Displays coordinates over the viewport and/or image, no distinction is made between these via color or iconography.

My question is whether there is a benefit to the user to clear the coordinates or leave them. I honestly don't see much difference either way, though I do like the thought of displaying coordinate locations over the viewport but NOT over the image as this seems to be consistent behavior in other apps.

Will investigate further.

from photodemon.

Kroc avatar Kroc commented on August 18, 2024

Doing what everybody else does is not necessarily the right thing :P That's why there's so many Photoshop-clones and nobody learns from Adobe's many, many mistakes.

What practical upshot is there to display co-ords that no longer match where the mouse is any more? The main issue I can see is trying to measure a pixel near the edge of the canvas, in that case, the better option is to lock the range of the co-ords but update them even when the mouse is outside the canvas, i.e. when the mouse is above the image, the Y would be 0, but the X would continue to update even though the mouse is not within the image. This would be useful, rather than displaying out-of-date co-ords that no longer apply to the mouse.

from photodemon.

tannerhelland avatar tannerhelland commented on August 18, 2024

Where did I say I'm doing what everybody else does? I always investigate other software's behavior on matters like this, because there is a good chance they have already looked at the implications of such a change and adjusted their software accordingly.

The practical upshot of NOT clearing coordinates is that clearing them is a non-trivial fix, especially in an MDI app. There are two ways to check the mouse location leaving - subclassing individual MDI child forms and intercepting WM_MOUSELEAVE events (unsafe in IDE, lots of work in VB), or setting up a timer to constantly compare mouse locations to that of the active MDI child (inelegant, resource-consuming).

This gets more complicated when I consider future-proofing. Most paint tools allow paint and selection operations outside the canvas. (You have even submitted a bug report about starting selections outside the canvas.) Most software allows paint operations outside the viewport, for example if you are painting a line onto a very large image at 100% zoom and you push the mouse far to the right, off the edges of the screen - most software will continue drawing a line onto the canvas "virtually" beneath that location. Some software allows you to even adjust a canvas size this way; you can make a selection that is simultaneously over and not over the image, and if you crop to that using a specific type of crop command, the image canvas will be enlarged to match the new selection.

So a "clearing the mouse coordinates" solution isn't as straightforward as one might think at a glance. I'll continue to investigate possible solutions, as I don't think the solution is quite so clear-cut yet - especially not when you consider the work required to reliably clear the mouse coordinates display.

from photodemon.

Kroc avatar Kroc commented on August 18, 2024

Ah, yes, I am forgetting the simple limitations for VB's forms; you would indeed have to subclass the crap out of it all and that makes it a nightmare for debugging.

from photodemon.

tannerhelland avatar tannerhelland commented on August 18, 2024

Mouse coordinates now display position relative to the image, even when not over the image. Also, selections (and by extension, future tools) require the ability to interact with the image outside its established boundaries.

As this issue is such low priority with no clear benefit to the user, I'm marking it "wontfix" for now.

from photodemon.

Kroc avatar Kroc commented on August 18, 2024

Beautiful work :)

from photodemon.

tannerhelland avatar tannerhelland commented on August 18, 2024

Thanks, buddy.

Of course, I now have to admit that I am a big fat liar. Between the original discussion on this issue and now, I've implemented a subclassing system that is both IDE-safe and hugely simplified. Despite all my bitching, this allows me to easily add "clear mouse when not over active viewport" functionality. :) I had this epiphany just after marking this as "wontfix".

So there you go, lol.

from photodemon.

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.