BandageNG icon indicating copy to clipboard operation
BandageNG copied to clipboard

Ensure proper colorer range for depth range

Open milenovic opened this issue 11 months ago • 5 comments

resolves #161

milenovic avatar Jan 23 '25 19:01 milenovic

Will you please rebase the PR?

asl avatar Jan 23 '25 19:01 asl

I am not sure I understand how to do it best. Colorers are transient, so that means we need to store either the scope or the calculated lowValue and highValue somewhere so they can be acessed by the depth colorer, correct? Colorer can be changed without redrawing the graph, so I didn't see a way to access scope from the depth colorer in that case.

milenovic avatar Jan 24 '25 05:01 milenovic

The colorer is switched in a single place: https://github.com/asl/BandageNG/blob/dev/ui/mainwindow.cpp#L1364 (while it is currently in settings, it just it was not untangled fully from the global state, it really should belong to mainwindow, or rather we'd need to have UI Model speaking in MVVM terms).

So, you might want to check if the current scheme is coloring by depth, then cast interface to instance of DepthColorer and pass the scope there. The DepthColorer would recalculate min / max values then.

asl avatar Jan 25 '25 00:01 asl

Is my latest approach in 91f7cf281d48974d1caa660d734d596e9667ccfd adequate? Along the way, in c31a7f993ddf52a18cdc2e7da118956669575160 I fixed the dependency issue that caused linux tests to fail as Ubuntu >24.04 image does not longer include imagemagick by default.

milenovic avatar Feb 04 '25 23:02 milenovic

Sorry, got distracted to something else. Will check soon!

asl avatar Feb 26 '25 11:02 asl