Skip to content

Commit abbfc6b

Browse files
committed
fix(ui-svg): android fix for aspect ratio
1 parent d0be834 commit abbfc6b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/ui-svg/index.android.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,17 @@ export class SVG extends SVGBase {
152152
const nativeWidth = box ? box.width() : width;
153153
const nativeHeight = box ? box.height() : height;
154154

155-
const nativeAspectRatio = nativeWidth / nativeHeight;
156-
const boundedAspectRatio = width / height;
155+
// const nativeAspectRatio = nativeWidth / nativeHeight;
156+
// const boundedAspectRatio = width / height;
157157

158-
let paintedWidth = width;
159-
let paintedHeight = height;
160-
if (nativeAspectRatio >= boundedAspectRatio) {
161-
paintedHeight = paintedWidth / nativeAspectRatio;
162-
} else {
163-
paintedWidth = paintedHeight * nativeAspectRatio;
164-
}
158+
const paintedWidth = width;
159+
const paintedHeight = height;
160+
// does not seem like we need this. Handled by options?
161+
// if (nativeAspectRatio >= boundedAspectRatio) {
162+
// paintedHeight = paintedWidth / nativeAspectRatio;
163+
// } else {
164+
// paintedWidth = paintedHeight * nativeAspectRatio;
165+
// }
165166
const xOrigin = (width - paintedWidth) / 2.0;
166167
const yOrigin = (height - paintedHeight) / 2.0;
167168
options = options.preserveAspectRatio(this._preserveAspectRatio);

0 commit comments

Comments
 (0)