-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve rendering performance by drawing background only to the clip area, resulting in less memory overhead when zoomed. The same technique is applied to polygons. Improve polygon creation on a Path to simplify code and improve reuse.
- Loading branch information
1 parent
a3c11cb
commit 548c0cc
Showing
5 changed files
with
23 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'dart:ui'; | ||
|
||
extension PointsExtension on List<List<double>> { | ||
List<Offset> toPoints(int extent, int tileSize) => map((point) { | ||
final x = (point[0] / extent) * tileSize; | ||
final y = (point[1] / extent) * tileSize; | ||
return Offset(x, y); | ||
}).toList(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters