feat!: migrate Point<double> to Offset internally#1996
feat!: migrate Point<double> to Offset internally#1996mootw merged 54 commits intofleaflet:masterfrom
Point<double> to Offset internally#1996Conversation
mapController.camera.pointToLatLng
JaffaKetchup
left a comment
There was a problem hiding this comment.
Some things I would be even more heavy handed/breaking on. I would be in favour of implemented deprecated methods just to ease the transition for external users, but I think we need to be more thorough.
Is there any reason for keeping Bounds using Point?
Point<double> to Offset internally
Yes, I have only migrated the Point interface methods in |
Co-authored-by: Luka S <github@jaffaketchup.dev>
…le.dart Co-authored-by: Luka S <github@jaffaketchup.dev>
most methods on integer bounds are not used
JaffaKetchup
left a comment
There was a problem hiding this comment.
Just a couple things left, mostly nits.
Co-authored-by: Luka S <github@jaffaketchup.dev>
Co-authored-by: Luka S <github@jaffaketchup.dev>
Co-authored-by: Luka S <github@jaffaketchup.dev>
JaffaKetchup
left a comment
There was a problem hiding this comment.
LGTM 🎉. Performance seems to have improved (about 0.2ms on home page example app, 0.3-0.4ms on basic polygon page, untested others), enough to actually make things feel slightly smoother (but maybe that's just a placebo). Don't notice any bugs, and code looks good.
There was a problem hiding this comment.
I like these changes. 😄
Maybe a feature release would be good before merging breaking changes?
Edit: I wouldn't be sad if we'd not use records here, but pr is fine as is too. (:
final (minx, miny) =
transformation.transform(b.min.dx, b.min.dy, zoomScale);
final (maxx, maxy) =
transformation.transform(b.max.dx, b.max.dy, zoomScale);|
i like that for future changes. I want to avoid creeping scope on this PR too much for now. we could wait to release for more changes |
| ? (point - (camera.nonRotatedSize / 2.0)) | ||
| : Point(offset!.dx, offset.dy)) | ||
| .rotate(camera.rotationRad); | ||
| final rotationCenter = (camera.projectAtZoom(camera.center) + offset!) |
There was a problem hiding this comment.
Hi @hket-tommyluk,
Sorry if we've made a mistake! Can you please file a bug report if this is causing an issue and we'll look into it. I'm not clear what this would cause.
This will yield significant performance benefits due to a reduction in casting. This likely breaks the external API but it is worth it
Migrations:
Point<double>->OffsetorSizeBounds<double>->RectBounds<int>-> (rename and marked internal)IntegerBoundsmaybe fixes #1769 (it is not a full migration, as there are still record types (they are okay in certain conditions honestly, especially as an interface between public apis), but it does fix a TON of issues with math.Point, which is much slower than the difference between Objects and Records)
there is a modest 7% performance boost in the polygon and polyline tests in both the UI and Raster threads in my debug mode profiling. i expect other layers to benefit and more performance boost in ideal situations