bluescan / tacentview

An image and texture viewer for tga, png, apng, exr, dds, pvr, ktx, ktx2, astc, pkm, qoi, gif, hdr, jpg, tif, ico, webp, and bmp files. Uses Dear ImGui, OpenGL, and Tacent. Useful for game devs as it displays information like the presence of an alpha channel and querying specific pixels for their colour.
ISC License
377 stars 36 forks source link

No pointer when selecting behind an image #181

Closed Vladik01-11 closed 1 week ago

Vladik01-11 commented 2 months ago

If "Show Images Tiled" will be active, then selecting some point not on the main image, the pointer will be shown on the main image. (normal) image

However, by turning off "Show Images Tiled", there will be no pointer, but the Cursor and Color from the selected pixel will be updated (in my case the edge in X and the current height in Y) (not normal). image

Fix to have the pointer on the edge of the image (probably more correct) or as with "Show Images Tiled" enabled

bluescan commented 2 months ago

What you're suggesting makes sense... you can only select pixels essentially in the main image rather than the tiles around it. The other option is to allow selection outside but when turning tiling off don't 'go to the edge' but rather keep the proper relative location. I'll take a look at this when I can. Thanks for the report.

bluescan commented 2 months ago

Hmm. I'm having difficulty repo'ing this. Under Preferences->Interface what is the Reticle Mode set to? Is this on Windows or Linux? Are you at the latest version of the viewer and are you using ctrl-T or pressing the tile button to turn off tiling? For me the reticle remains visible when I turn off tiling.

bluescan commented 2 months ago

Checked in win11 and kubuntu 24.04 (x11 and experimental wayland)

Vladik01-11 commented 2 months ago

Under Preferences->Interface what is the Reticle Mode set to?

On Select

Is this on Windows or Linux?

Windows 10

Are you at the latest version of the viewer and are you using ctrl-T or pressing the tile button to turn off tiling?

I use the latest release at the moment (v1.0.45) and activate using the button I experimented with "Reticle Mode" and here is what I can say:

https://github.com/user-attachments/assets/66f0b78e-205c-425e-85dd-f71ea8b59942

bluescan commented 2 months ago

Ah I see what you're saying (I had thought the act of turning off tiling was hiding the reticle). OK, so in non-tiled and 'On Select' reticle-mode I had wanted a way of easily hiding the reticle -- and clicking outside the image (where there are of course no pixels) makes sense... you are selecting nothing. You are right in this sense though: if you are selecting 'nothing' why does the colour change (it's actually finding the closest pixel on the perimeter)... it should indicate nothing is selected.

If I do the solution "Fix to have the pointer on the edge of the image" while in "On Select" mode, what you essentially end up with is "Always Visible" reticle behaviour anyway... so you may want to use that.

I should, however, for 'On Select' do the fix of not showing a valid colour or position if you click outside the image.

Vladik01-11 commented 2 months ago

If I do the solution "Fix to have the pointer on the edge of the image" while in "On Select" mode, what you essentially end up with is "Always Visible" reticle behaviour anyway... so you may want to use that.

I should, however, for 'On Select' do the fix of not showing a valid colour or position if you click outside the image.

Then you should also change the 'On Select' logic outside the image so that the data doesn't change at all, or the pointer, color data, and coordinates become the defaults

bluescan commented 2 months ago

Give cb6796f100ad6e1f410d00c77bc4fe61ba77d482 a go. "Changed OnSelect reticle behaviour to not update the cursor position when a position outside the image is selected. A right-click or cursor-move (shift dir-key) will make the reticle visible again."

It's more along the lines of just doing the part you suggested: 'data doesn't change at all' rather than hiding the colour swatches etc. This also has the benefit that if you are editing a pixel, you can now click outside the image to hide the reticle and adjust the colour without being distracted by the reticle cross (or outline if zoomed in).

If you want the reticle visible again without selecting another pixel, just right-click.

Vladik01-11 commented 1 week ago

Works more predictably now, but guessing before using the PCM will be difficult for a new user)