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
373 stars 36 forks source link

Allow cropping area to be dragged around #95

Closed ClangPan closed 1 year ago

ClangPan commented 1 year ago

Hello,

Cropping anchors seems to behave weirdly, only moving the view and not the cropping area. I presume this is not intended behavior as this feature would seem useless otherwise in my eye. Modifiers keys also do nothing while resizing the area in case that's relevant.

https://user-images.githubusercontent.com/99129533/218507662-188d8961-54e3-45c3-8b38-dbf7ddcbb256.mp4

It also brings to mind that there is no visible option to drag around the crop area, you're only able to drag the edges and corners

bluescan commented 1 year ago

So the anchor changing just the view was actually as intended. I found when cropping large images I would usually be zoomed in so I could easily get it pixel-perfect (to remove a border for example) and I'd be at the maybe the top-left...more often than not I'd then want to go to the bottom-right, and instead of panning around or dragging sliders, it was convienient to just press the bottom-right button to bring it into view and adjust from there.

For the modifiers I assume you mean the shift with direction arrows to move one pixel at a time? This does actually work but you need to click the anchor or edge you want to adjust first. It might be better if it just went with the last edge or corner that was highlighted/hovered over?

Dragging around the crop area is a good idea (with or without holding shift).

ClangPan commented 1 year ago

I see, I hadn't considered that, that's useful even if it's very specific, maybe making the relationship between the buttons and the panning more obvious would be better (and perhaps change the name since "anchor" doesn't really fit that description). "View shortcuts" might be more appropriate? But I'm honestly nitpicking here. I got confused since the arrangement of buttons is very similar to how other programs handle anchors.

As for modifiers, I was referring to other programs such as Photoshop or GIMP where holding modifiers keys while dragging the edges of selections allows for things like proportional scaling, but since you haven't added anything else I assume it works as expected (Shift + arrows work correctly).

ClangPan commented 1 year ago

Actually I just noticed I've misunderstood what the anchors were. They refer to the corners of the selection, correct? I thought it was for something else, my bad

bluescan commented 1 year ago

Yes.. exactly. Your suggestion to call them 'View Shortcuts' seemed good to me. That's now in 8e79ad10d00a0fa3eb3f89093631adb123be6e03

Regarding modifiers (like propartional scaling), I'll leave this open for a bit and if I have time take a look at GIMP etc to see how they do this.

I'm also going to rename this task to 'allow cropping area to be dragged around'... cuz that should prolly be done at some point ;)

bluescan commented 1 year ago

Actually I was wrong.. they're for the corners of the image. Arguably they should be for the selection/current-crop area...would need to think about that. In any case, they still seem handy and view-shorcuts still seems like a good name :) Thx for the feedback.

bluescan commented 1 year ago

84997ce50452442418cc5bd72aa8e82fb171b51d implements ability to move whole cropping area around with a center-image handle.