-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rectangle/Ellipse: Add "Outline width" slider #629
Conversation
566afd8
to
897093d
Compare
Very appreciated change!
Personally, I'd rotate first, then adjust the width. But is doesn't really matter... |
well...since it's code I'm sure there is something that can be done. 😄 But I would need to learn what that is. The problem is just that we need to draw the shape and erase it and re-draw it and I'm not totally sure how to do that with a BView. I believe I've seen stuff with "offscreen" views or bitmaps in Haiku. This flickering occurs pretty much everywhere there's an interactive UI in ArtPaint but I think it's just a lot more noticeable with thick solid shapes. The easiest "solution" in this case would be to not show the line thickness until after you are done rotating, but that seems less than ideal. |
Hmm, I lied, the straight line tool with a Width of 100 doesn't flicker at all. I will look into it. |
897093d
to
9c8c48d
Compare
I think I made it a tiny bit better, but to really fix it the way the drawing is done would need to be changed to the way StraightLineTool does it - which to render it the same way we render the final straight line, using ArtPaint's drawing methods. Rectangle and Ellipse use Haiku's drawing. I may attempt this. |
Good luck on your anti-flicker mission! |
It’s actually going pretty well. I might be done by tomorrow. The code is rather ugly though.
I’m not sure how to do this so that it wouldn’t be confusing. Like just a circle of the appropriate size? |
Ugly but working code may be improved with time. :)
Yes, I think a circle or square of the outline-width would give an indication what to expect. |
what about when “fill” is checked? Don’t show it? |
Don't show it, I'd say, because a filled rect has no outline. |
I feel like that’s a little weird because then sometimes you see it and sometimes you don’t? |
Your call, ofc. Not confusing to me though 😃 |
9f79a17
to
83f0d65
Compare
Ok - please give it a try when you have a moment - there are some artifacts when you rotate quickly or resize quickly but I think it works well overall. I even think it works when you zoom while drawing/rotating. Haven't tried the draw-circle-to-indicate-size yet; this is just the flicker fix. |
Yep, appart from the artifacts, the heavy flicker is gone. Nice! |
- Changed Rectangle and Ellipse drawing to use multiple buffers like other drawing tools. This allows display of actual alpha color as well as new outline width feature.
How bad are the artifacts on your end? |
I tried both in WebPositive and Firefox on Linux and the video doesn't show - but the image is enough. It is bad that the artifacts actually paint on the image permanently. |
83f0d65
to
cd977ff
Compare
updated and I think it's better - I can only see slight corner artifacts on rotation of a rectangle, and I can't get them to stay. But the artifacts when resizing should be gone now. |
Sorry about that. I tried uploading it to my ussual https://0x0.st, but it kept timing out. Anyway, with your latest change it is much better. Resizing, as you said, doesn't leave artifacts anymore at all. But I still manage to produce some sticky artifacts when rotating. Most disappear when I keep rotating, but a few remain. There's also quite some tearing, isn't there? |
cd977ff
to
95ffb17
Compare
Ok, I made the rotating a bit more efficient and shouldn't have any artifacts. Occasionally I see cut-off corners but no extra artifacts, and the corners always reappear when the rectangle is final. I tried to address the tearing by slowing down the updates and removing the forced image updates and I think it's better. If you are resizing like a crazy person you can't expect a perfect view. 😆 |
Much better! And yes, the cut-offs seem to depend on rect size and possibly where it is on the canvas. Only apppear whilst rotating and are gone when actually drawing the result on canvas. A video uploaded to my mailbox.org cloud. Let me know if you can view/download it. Otherwise, merge when ready, I'd say. |
Ok, I was able to download and watch the video - that's far worse than what I was referring to. I have only seen tiny corners getting cut off, not like 1/3 of the rectangle. I'll see if I can repro and fix that before merging. |
95ffb17
to
b49aad3
Compare
ok, I think I fixed it. |
b49aad3
to
5e02aa7
Compare
No, NOW I think it's fixed for real. 😄 |
5e02aa7
to
48056a2
Compare
Very good! |
merged! |
Addresses #174
... I'm not sure about the "Adjustable outline width" option. Would that happen after rotation? I didn't add that part for now.
A few caveats; the preview drawing has some issues where it doesn't draw correctly, but the actual drawn shape is usually correct. For example:
(1) might also be weird Haiku view drawing behavior?