Page MenuHomePhabricator

PlanarFigures always recompute their PolyLines
Closed, ResolvedPublic

Description

All PlanarFigures implement a method GeneratePolyLine() which computes their PolyLine, which is the polygon that will actually be rendered, from their ControlPoints.

This method is called from PlanarFigure::GetPolyLine(). This is where the logic is implemented that checks if the PolyLine is still up-to-date or has to be re-calculated.

Unfortunately this logic is wrong! Thus, every time PlanarFigure::GetPolyLine() is called, the PolyLine is recalculated. In case of the PlanarSubdivisionPolygon this is actually quite costly as the interpolation has to be calculated every single time.

Asthe PlanarFigureInteractor needs the PolyLine to check for hovering, the PolylIne is calculated after every single mouse-move that is performed.

Event Timeline

New remote branch pushed: bug-14038-wrong-polyline-updating

I fixed the logic now. The PolyLine is now only recalculated if

  • the variable 'm_PolyLineUpToDate' is false (has already been correct!)

or

  • the requested index is greater than the number of already calculated polylines -> This is where the error was!

This is a very simple bugfix that should speed up PlanarFigure rendering and interaction!

Integration into master pending, this is not yet RESOLVED

[1dd805]: Merge branch 'bug-14038-wrong-polyline-updating'

Merged commits:

2012-12-18 13:24:43 Daniel Maleike [1f7b15]
Invalidate polylines in Append... methods


2012-12-17 15:05:38 Markus Engel [9de853]
fixed logic to check if polyline is up-to-date