mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Merge pull request #3762 from NativeScript/fix-image-scaling
Fix iOS image scaling to work in px
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.6 KiB |
BIN
apps/app/App_Resources/iOS/testlogo.jpg
Normal file
BIN
apps/app/App_Resources/iOS/testlogo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
@ -7,8 +7,8 @@
|
||||
|
||||
<!-- Resources: png and jpg -->
|
||||
<WrapLayout>
|
||||
<Image src="res://icon" stretch ="none" />
|
||||
<Image src="res://testlogo" stretch ="none" />
|
||||
<Image src="res://icon" stretch="none" />
|
||||
<Image src="res://testlogo" stretch="none" />
|
||||
</WrapLayout>
|
||||
|
||||
</StackLayout>
|
||||
|
@ -53,8 +53,8 @@ export class Image extends ImageBase {
|
||||
let height = layout.getMeasureSpecSize(heightMeasureSpec);
|
||||
let heightMode = layout.getMeasureSpecMode(heightMeasureSpec);
|
||||
|
||||
let nativeWidth = this.imageSource ? this.imageSource.width : 0;
|
||||
let nativeHeight = this.imageSource ? this.imageSource.height : 0;
|
||||
let nativeWidth = this.imageSource ? layout.toDevicePixels(this.imageSource.width) : 0;
|
||||
let nativeHeight = this.imageSource ? layout.toDevicePixels(this.imageSource.height) : 0;
|
||||
|
||||
let measureWidth = Math.max(nativeWidth, this.effectiveMinWidth);
|
||||
let measureHeight = Math.max(nativeHeight, this.effectiveMinHeight);
|
||||
|
Reference in New Issue
Block a user