Class CmsBoxFit
java.lang.Object
org.opencms.ade.galleries.client.preview.util.CmsBoxFit
- All Implemented Interfaces:
I_CmsTransform
A coordinate system transform for translating between coordinates relative to a rectangle and the coordinates relative to a second
rectangle with the first rectangle fit into the second one, either by just centering if possible or by centering and scaling it.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionCmsBoxFit
(CmsBoxFit.Mode mode, double width, double height, double naturalWidth, double naturalHeight) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptiontoString()
org.opencms.ade.galleries.shared.CmsPoint
transformBack
(org.opencms.ade.galleries.shared.CmsPoint point) Applies the inverse of the transformation to a point.org.opencms.ade.galleries.shared.CmsPoint
transformForward
(org.opencms.ade.galleries.shared.CmsPoint point) Applies the transformation to a point.
-
Constructor Details
-
CmsBoxFit
public CmsBoxFit(CmsBoxFit.Mode mode, double width, double height, double naturalWidth, double naturalHeight) Creates a new instance.- Parameters:
mode
- the scale modewidth
- the width of the first rectangleheight
- the height of the first rectanglenaturalWidth
- the width of the second rectanglenaturalHeight
- the height of the second rectangle
-
-
Method Details