MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / scaledWidth

Method scaledWidth

CodenameOne/src/com/codename1/ui/Image.java:1743–1746  ·  view source on GitHub ↗
(int width)

Source from the content-addressed store, hash-verified

1741 ///
1742 /// the newly created image
1743 public Image scaledWidth(int width) {
1744 float ratio = ((float) width) / ((float) getWidth());
1745 return scaled(width, Math.max(1, (int) (getHeight() * ratio)));
1746 }
1747
1748 /// Scales the image to the given height while updating the width based on the
1749 /// aspect ratio of the height

Callers 6

scaledImplMethod · 0.95
testScaledWidthMethod · 0.95
setIconMethod · 0.45
invoke8Method · 0.45
addToReelMethod · 0.45
addToReelMethod · 0.45

Calls 4

getWidthMethod · 0.95
scaledMethod · 0.95
maxMethod · 0.95
getHeightMethod · 0.95

Tested by 2

testScaledWidthMethod · 0.76
addToReelMethod · 0.36