domain/helpers library
Functions
-
computeSizeWithRatio(
Size layout, double r) → Size -
Returns a desired dimension of
layout
that respectr
aspect ratio -
resizeCropToRatio(
Size layout, Rect crop, double r) → Rect -
Returns a new crop Rect that respect
r
aspect ratio inside alayout
and based on an existingcrop
area -
scaleToSize(
Size layout, Rect rect) → double -
Return the scale for
rect
to fitlayout
-
translateRectIntoBounds(
Size layout, Rect rect) → Rect -
Returns a translated Rect that fit
layout
size