-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[google_maps_flutter] Allow BitmapDescriptor scaling override #1737
Conversation
| assetName, | ||
| configuration.devicePixelRatio, | ||
| ]); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 76 can be configuration.devicePixelRatio ?? assetBundleImageKey.scale
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
|
please also change the pubspec.yml and changelog files. |
| @@ -1,3 +1,7 @@ | |||
| ## 0.5.17+1 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to 0.5.19 please. Thanks
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
| assetName, | ||
| configuration.devicePixelRatio, | ||
| ]); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
…ling-bitmap # Conflicts: # packages/google_maps_flutter/CHANGELOG.md # packages/google_maps_flutter/pubspec.yaml
iskakaushik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comment has been minimized.
This comment has been minimized.
|
This CL breaks loading assets of correct scale. It passes the path to 1.0 scaled asset, and the scale ratio to Java, where however the scale is discarded. So even if mipmaps are available, always the 1.0x asset will be loaded. Can we revert? |
This comment has been minimized.
This comment has been minimized.
That's true, but in order to load the correct mipmap on Flutter, I can't pass null. Here's what I'm doing: With this CL, mipmap of scale 1.0 will be loaded, even though the imageConfiguration has scale 3.0. Something is clearly broken, as the incorrect asset is loaded when you pass a scale in ImageConfiguration.
Passing null doesn't help, as then mipmaps won't be used. Just tried. Also, not sure why would I override devicePixelRatio with null, if the one provided by Flutter's createLocalImageConfiguration is correct. It's just after this CL, the value is ignored. |
Description
Patch for BitmapDescriptor.fromAssetImage that respects ImageConfiguration.devicePixelRatio
Related Issues
fixes flutter/flutter#34386
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?