-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Document scale parameter for Image and RawImage #153728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document scale parameter for Image and RawImage #153728
Conversation
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.
Thanks for improving the documentation here.
Could you also add this explanation to the RawImage.scale
field?
/// The linear scale factor for drawing this image at its intended size.
///
/// The scale factor applies to the width and the height.
///
/// {@macro flutter.painting.imageInfo.scale}
final double scale;
Sure! |
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, thanks for doing this!
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 PR documents the scale parameter for Image and RawImage. It adds the quote from the [Image.memory](https://main-api.flutter.dev/flutter/widgets/Image/Image.memory.html) for other constructors like: `Image.asset`, `Image.new`, `Image.network`, `Image.file` and `RawImage` > The scale argument specifies the linear scale factor for drawing this image at its intended size and applies to both the width and the height. For example, if this is 2.0, it means that there are four image pixels for every one logical pixel, and the image's actual width and height (as given by the [dart:ui.Image.width](https://main-api.flutter.dev/flutter/dart-ui/Image/width.html) and [dart:ui.Image.height](https://main-api.flutter.dev/flutter/dart-ui/Image/height.html) properties) are double the height and width that should be used when painting the image (e.g. in the arguments given to [Canvas.drawImage](https://main-api.flutter.dev/flutter/dart-ui/Canvas/drawImage.html)). flutter#148623
This PR documents the scale parameter for Image and RawImage.
It adds the quote from the Image.memory for other constructors like:
Image.asset
,Image.new
,Image.network
,Image.file
andRawImage
#148623
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.