MCPcopy
hub / github.com/ollm/OpenComic / calcAspectRatio

Function calcAspectRatio

scripts/reading.js:272–295  ·  view source on GitHub ↗
(first, second)

Source from the content-addressed store, hash-verified

270
271//Calculates the size and position of the images
272function calcAspectRatio(first, second)
273{
274 if(!first)
275 return false;
276
277 if(second)
278 {
279 if(first.folder)
280 first.aspectRatio = 1;
281 else if(first.blank)
282 first.aspectRatio = second.folder ? 1 : imagesDataClip[second.index].aspectRatio;
283 else
284 first.aspectRatio = imagesDataClip[first.index].aspectRatio;
285 }
286 else
287 {
288 if(first.folder)
289 first.aspectRatio = 1;
290 else
291 first.aspectRatio = imagesDataClip[first.index].aspectRatio;
292 }
293
294 return first;
295}
296
297function disposeImages(data = false)
298{

Callers 1

disposeImagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected