Skip to content

Commit ddebd70

Browse files
committed
Fix an off-by-one bug when adding points to a diverging colormap
Symptom: if we added a new point on the lower side of the colormap, adjacent to the middle "fixed point", then the new point would become the fixed point and the original fixed point would become part of the upper half of the colormap.
1 parent a222272 commit ddebd70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

viscm/bezierbuilder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_control_points(self):
5757
def add_point(self, i, new_x, new_y):
5858
self._xp.insert(i, new_x)
5959
self._yp.insert(i, new_y)
60-
if self._fixed is not None and i < self._fixed:
60+
if self._fixed is not None and i <= self._fixed:
6161
self._fixed += 1
6262
self.trigger.fire()
6363

0 commit comments

Comments
 (0)