Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 08201817 authored by Darren Salt's avatar Darren Salt
Browse files

Spline: limit control point X co-ordinates to the graph area.

This fixes an oversight in the control point handling which allows
the X co-ordinate to be outside the range 0..1 if the width of the
graph (including margins) is less than the width of the display.

On my Nexus 4, without this fix, this problem occurs in landscape
mode when dragging a control point outside the graph area,
effectively onto the system buttons area. This bad X co-ordinate and
a lack of bounds checking causes an 'index out of range' exception to
be thrown from within Spline.getAppliedCurve().

The Y co-ordinate is already suitably handled; this commit copies and
adapts that handling for the X co-ordinate. It also adds the
necessary bounds checking to Spline.getAppliedCurve().

Change-Id: I325a1b6837927a6dd050b30209a7beeadf76d089
parent 1a9cc7ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment