HaikuArchives / ArtPaint

ArtPaint is a painting and image processing program.
https://haikuarchives.github.io/ArtPaint/
29 stars 18 forks source link

BrushEditor: size preview based on max dimension to avoid jumping #644

Closed dsizzle closed 7 months ago

dsizzle commented 8 months ago

Fixes #523

(but watch out for #643 when testing, which is unrelated to this change)

humdingerb commented 8 months ago

Works in the "Brushes" window, but there are sometimes artifacts in the canvas window status bar preview, esp. while rotating.

Hmm, cannot upload a file. Not possible in a PR comment? Anyway, uploaded as https://0x0.st/Ht-B.png


There's also a cut-off in the Brushes preview sometimes:


I also had to remove the ArtPaint settings or it crashed on launch: https://0x0.st/Ht-u.report

dsizzle commented 8 months ago

Did I mention that I knew this would be a pain in the backside to fix? :smile:

dsizzle commented 8 months ago

Ok, please give it another try - it's slightly different than before in that the brush won't keep growing and shrinking; once it reaches "maximum" size, only the red bar changes, but I think that kind of makes sense rather than continually growing and shrinking.

I do want to put a number indicating the numerical size someday, rather than just that bar.

humdingerb commented 8 months ago

I like it. Let me put this heretic thought to you: let's scrap the red line. There, I said it. :) It was kinda neat when you had fixed scales - 1:1, 1:2, 1:3 - and the brush size in the preview changed. But now, with the brush size being constant and the scale incrementally in/decreasing, the usefulness of the line is rather diminished. To be frank, even before, the red line only gave you a rough sense of the actual brush size when it was 1:2 or 1:3. Above that it was hard to tell if it's 1:4 or 1:5...

Anyhow, here's a mockup of the size as number in a corner: https://0x0.st/HtXZ.png

Oh, and a large rect brush still gets cut-off at the right side of the preview.

dsizzle commented 8 months ago

Let me put this heretic thought to you: let's scrap the red line. There, I said it. :)

I never really understood the red line honestly. I don't think it conveys much information. I think a number would be so much better - but I was just going to write it on top of the brush like Photoshop does, not a fancy gray border or anything.

Oh, and a large rect brush still gets cut-off at the right side of the preview.

WHAT? Hmm, I didn't have that happen - I will look into it more.

EDIT: I see it now. Weird. I thought I had it fixed.... seems to be only with Aspects closer to 0.

humdingerb commented 8 months ago

Another idea I just had. Hey, don't you roll your eyes at me, young man! :)

The thing is, even a number with the pixel size often isn't that helpful. It's OK as size indicator for the stored brushes pane. But for actually drawing with it on the canvas, it's just a number. The actual size of the drwn line depends on the dimensions of the canvas and the current zoom level. It would be nice, if while you're fiddling with the brush sliders, there'd be an overlay of the current setting on the canvas itself.

dsizzle commented 8 months ago

Ok, I removed the red line and added a number for the size when it's larger than the preview.

It would be nice, if while you're fiddling with the brush sliders, there'd be an overlay of the current setting on the canvas itself.

:roll_eyes:

Just use the Freehand tool with the "Use current brush" mode, and move the mouse over the canvas. Done.

humdingerb commented 8 months ago

Sure, but then you have to move back and forth between the sliders and the canvas. Having the constantly updated outline overlay in the middle of the canvas while you're twiddling the sliders would be neat. But, as I said, just an idea. Many more fishies to fry in the deep ArtPaint ocean...

humdingerb commented 8 months ago

The brush not being in the center is a bit weird when resizing it and becomes a little wilder when rotating: https://0x0.st/HtAR.mpeg Not necessaril bad, but unexpected... :)

To keep the GUI stable and also because the size info can also be handy for smaller sizes, I'd suggest showing it always.

I think we could get away with a smaller font size for the size info.

Keeping the brush filling the preview pane as before, but just slapping the size info on top in a corner isn't easily done, I assume. Probably some flickering/drawing views on top of each other/or a similar nuisance?

dsizzle commented 8 months ago

The brush not being in the center is a bit weird when resizing it and becomes a little wilder when rotating

Ok, I must really be having an off-day. I swear I fixed that so it's always centered. It's not supposed to be like that at all. It's supposed to be centered. So -

Not necessaril bad, but unexpected... :)

To keep the GUI stable and also because the size info can also be handy for smaller sizes, I'd suggest showing it always.

will do.

Keeping the brush filling the preview pane as before, but just slapping the size info on top in a corner isn't easily done, I assume.

That's not hard, but I'd have to draw a white rectangle behind it or something so the text is legible - I don't think it'll flicker or anything.

humdingerb commented 8 months ago

That's not hard, but I'd have to draw a white rectangle behind it or something so the text is legible - I don't think it'll flicker or anything.

May be worth a try. Few brushes fill the preview all the way to its corners, so obscuring that part wouldn't be bad. And that way we wouldn't waste vertical space needlessly. And if you want to have it look nice, use a panel-background grey and draw the black frame border at the top and right of the size box, as in mockup from above... :) corner-size

dsizzle commented 8 months ago

OK, how 'bout now? I tried to do the fancy drawing but the black border is drawn by the parent view so I would have to change the code in the brush editor and the status view as well, and I'm too lazy to do that. :smile:

dsizzle commented 7 months ago

Ok, FINE, I did the "fancy" border - let me know if you see any other issues.

humdingerb commented 7 months ago

Beautiful! :)

Would it be possible to put the size numbers smack in the corner, without spacing to the left and bottom? That would save some space, see:

Now:

now

Then:

then

dsizzle commented 7 months ago

better?

humdingerb commented 7 months ago

Perfect! Thank you.

dsizzle commented 7 months ago

Excellent, merged