Closed shawnlaffan closed 2 months ago
The relevant code is at https://github.com/shawnlaffan/biodiverse/blob/ddc901f14b006c0727a881d69f88da5e32f35c3a/lib/Biodiverse/GUI/Manager/BaseDatas.pm#L775-L797
It can be simplified to this:
foreach my $widget (@resolution_widgets) {
$j++;
$widget->signal_connect (
'value-changed' => sub {
my $val = $widget->get_value;
my $remainder = fmod ($val, $cellsize_array[$j]);
if (abs ($remainder) > 10e-10) {
$widget->set_value ($val - $remainder);
}
return;
}
);
}
The logic is faulty when the system snaps new cellsizes to multiples of the current cellsizes, when the origin is non-zero.
The code should not even be using the origin in this case.