flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Refactor WidgetIndentsHighlightingPass and/or add tests here

Open helin24 opened this issue 3 years ago • 0 comments

This logic in paint is finicky and very hard to follow; I suspect we could do better.

As a first step, perhaps extract the contents of paint into a separate function generateLines that returns a collection of lines to paint (with x, y positions), then have paint only render these.

e.g.:

class LinesToPaint {
  int startX;
  int startY;
  ...
}

in paint:

LinePainter2D.paint(
  g2d,
  lineToPaint.startX,
  lineToPaint.startY,
  ...
);

And then we can at least test generateLines for regressions.

helin24 avatar Apr 21 '22 17:04 helin24