Skip to content

Conversation

@HiCamino
Copy link
Contributor

Refactored TranslationManipulator::PreviewBitmap to match how ScaleManipulator::PreviewBitmap works to make it work properly when ImageView is fixed. Basicaly makes updated region simpler.

i am reworking the checker bg to work properly with Haiku invalidate/draw/etc and in my branch TranslationManipulator doesn't work properly but with this fix it does. it should work exactly as before (but maybe better performance?) this isnt a feature change just a refactor.

I sometimes see little artifacts with a large selection and large image but i can't get it to happen regularly to debug it. it is only temporary and goes away when you click ok or cancel. let me know if it is bad or can figure out how to make it happen regularly but i have spent a while trying to fix it but not even sure why/when it happens. seems somehow related to moving off the edge of the image but its pretty rare?

ScaleManipulator::PreviewBitmap works to make it work properly
when ImageView is fixed. Basicaly makes updated region simpler.
to match how ScaleManipulator::PreviewBitmap works to make it work properly
when ImageView is fixed. Basicaly makes updated region simpler.
to match how ScaleManipulator::PreviewBitmap works to make it work properly
when ImageView is fixed. Basicaly makes updated region simpler.
to match how ScaleManipulator::PreviewBitmap works to make it work properly
when ImageView is fixed. Basicaly makes updated region simpler.
to match how ScaleManipulator::PreviewBitmap works to make it work properly
when ImageView is fixed. Basicaly makes updated region simpler.
to match how ScaleManipulator::PreviewBitmap works to make it work properly
when ImageView is fixed. Basicaly makes updated region simpler.
@humdingerb
Copy link
Member

Not sure you were talking about the same sort of artefacts, but I see some that are 100% reproducible.
Open Walter_the_OS.png from artwork/test images, select some part of it and ALT+T to translate. Now everytime you move the mouse upwards, you'll leave a trace of artefacts:

artefacts

@HiCamino
Copy link
Contributor Author

HiCamino commented Nov 24, 2025

no thats not what I was referring to. it was a single pixel wide line that flashed when moving.

but i dont see what you are seeing :( :( :(

walter01

this is what i see sometimes but not every time and it goes away so its hard to screenshot:

art01

@HiCamino
Copy link
Contributor Author

I pushed a change that might fix what you see. it is soemthing I changed to try to fix my artifact but might cause yours.

@humdingerb
Copy link
Member

Hold on...
I booted into Beta5 (I'm normally on a nightly now), and had to recompile to be able to launch under Beta5. I did "clean" the build, which I did not before on the nightly. And Lo!, no more artefacts.
Terribly sorry, I promise to always run a "clean" before testing from now on. :}

@humdingerb
Copy link
Member

OK, this time I got a real one... :)

8k-artefact

Happens when translating a selected area of a big 8k image. That black border with that light pixel pattern at the right and bottom edgeof the selection appears on mouse-up.

@humdingerb
Copy link
Member

BTW, had this crash on quit after playing around for a bit:
Uploading ArtPaint-7307-debug-24-11-2025-18-59-20.report.txt…

No idea if it could be related to this change.

@HiCamino
Copy link
Contributor Author

ok that artifact is more like what i see but the crash log link just goes back to this page. i think the file is missing

@HiCamino
Copy link
Contributor Author

also i know its related to this last_calculated_resolution stuff that scale doesnt have. if i set it to 1 all the time instead of calculating then there are no artifacts but i didnt want to remove that. i think it must make the math off somehow

@HiCamino
Copy link
Contributor Author

ok I still see random artifacts but I think its a lot better and more rare. can you please try the latest?

@humdingerb
Copy link
Member

First trying to upload that report again:
ArtPaint-7307-debug-24-11-2025-18-59-20.report.txt

Then: Well done, those border artifact is gone! I also haven't yet seen that artifact your reported before.

Translating does feel a bit less smooth that on master. Only really noticable with my big 8k image.
I suppose, possible optimizations could be exlored at a later time...

@HiCamino
Copy link
Contributor Author

thanks for testing and i dont think that crash is related to this change

@HiCamino
Copy link
Contributor Author

ok i did a few minor performance type things - i found some values calculated 2x so i removed them and also avoid calculating y values every time thru the x loop. i dont know if you can tell any difference

@humdingerb
Copy link
Member

Can't say I see a change in performance. Maybe some more improvements can be found in the future...
I'll leave the PR open a few more days to give others the weekend to chime in.

BTW, is the commit message detailed enough to give future devs an idea when they have a look at the change down the road? No real programmer myself, so I can't judge that. :)

@HiCamino
Copy link
Contributor Author

HiCamino commented Nov 27, 2025

is the commit message detailed enough to give future devs an idea when they have a look at the change down the road?

I dont know maybe i can add some comments to the code. next i have to rework selection so that might be scarier and then the rework of imageview for the checker bg might be scary too
so this one is not bad considering

overall artpaint code can be difficult in places!

@humdingerb
Copy link
Member

WRT the performance issue, I noticed that CPU cycles are burnt as long as that mouse button is pressed. While pressing the mouse button, the selection is shown with a reduced resolution. Maybe this computation runs more often than needed?

To see this:

  • Open the Pulse demo and keep it visible in the screen.
  • Open a huge image in ArtPaint, create a selection and ALT+T to translate.
  • Zoom into the selection (so you see the "blocky" resolution in the next steps).
  • Now press the mouse button and start moving the mouse -> see the reduced resolution and note the increased CPU activity of Pulse.
  • Stop moving the mouse, but don't release the mouse button -> the CPU activity stays high while there's still a "blockily reduced resolution".

@HiCamino
Copy link
Contributor Author

hold on i might be crazy but this pr might not be needed after all? testing with the checker bg branch more and not seeing the issues I saw before so if i cant repro it i will just close this pr. confused rn

selection toll still needs work however

@HiCamino
Copy link
Contributor Author

This PR doesnt seem to be needed so closing for now but will keep the branch in case its needed later

@HiCamino HiCamino closed this Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants