domain/helpers library
Functions
-
computeSizeWithRatio(
Size layout, double r) → Size -
Returns a desired dimension of
layoutthat respectraspect ratio -
resizeCropToRatio(
Size layout, Rect crop, double r) → Rect -
Returns a new crop Rect that respect
raspect ratio inside alayoutand based on an existingcroparea -
scaleToSize(
Size layout, Rect rect) → double -
Return the scale for
rectto fitlayout -
translateRectIntoBounds(
Size layout, Rect rect) → Rect -
Returns a translated Rect that fit
layoutsize