Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1034223 // calcFitScale

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (120L) is out of date.

1  
static double calcFitScale(BufferedImage image, Component c) {
2  
  ret calcFitScale(image, c.getWidth(), c.getHeight());
3  
}
4  
5  
static double calcFitScale(BufferedImage image, int w, int h default w) {
6  
  int iw = image.getWidth(), ih = image.getHeight();
7  
  ret max(doubleRatio(h, ih), doubleRatio(w, iw));
8  
}

Author comment

Began life as a copy of #1019468

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034223
Snippet name: calcFitScale
Eternal ID of this version: #1034223/4
Text MD5: fd3820063d5c14c890df2dc318fb34d6
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-29 03:03:34
Source code size: 308 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 142 / 213
Version history: 3 change(s)
Referenced in: [show references]