GUI: unable to change basedata cellsize when origin is non-zero
shawnlaffan opened this issue · 1 comments
shawnlaffan commented
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.
shawnlaffan commented
The relevant code is at
biodiverse/lib/Biodiverse/GUI/Manager/BaseDatas.pm
Lines 775 to 797 in ddc901f
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;
}
);
}