@@ -111,12 +111,12 @@ export default class ExampleLayout extends React.Component<{}, {width: number, h
111111 </ ResizableBox >
112112 </ div >
113113
114- < h3 > Absolutely Positioned layout </ h3 >
114+ < h3 > Absolutely Positioned Layout </ h3 >
115115 < div className = "layoutRoot absoluteLayout" >
116- < ResizableBox className = "box absolutely-positioned top-aligned left-aligned" height = { 200 } width = { 200 } resizeHandles = { [ 'se' , 'e ' , 's' ] } >
116+ < ResizableBox className = "box absolutely-positioned top-aligned left-aligned" height = { 200 } width = { 200 } resizeHandles = { [ 'sw' , ' se', 'nw' , 'ne' , 'w' , 'e' , 'n ', 's' ] } >
117117 < span className = "text" > Top-left Aligned</ span >
118118 </ ResizableBox >
119- < ResizableBox className = "box absolutely-positioned bottom-aligned left-aligned" height = { 200 } width = { 200 } resizeHandles = { [ 'ne' , 'e' , 'n' ] } >
119+ < ResizableBox className = "box absolutely-positioned bottom-aligned left-aligned" height = { 200 } width = { 200 } resizeHandles = { [ 'sw' , 'se' , 'nw' , ' ne', 'w' , ' e', 'n' , 's '] } >
120120 < span className = "text" > Bottom-left Aligned</ span >
121121 </ ResizableBox >
122122 { /* See implementation of `onResizeAbsolute` for how this can be moved around its container */ }
@@ -137,14 +137,61 @@ export default class ExampleLayout extends React.Component<{}, {width: number, h
137137 < span className = "text" > { "Raw use of <Resizable> element with controlled position. Resize and reposition in all directions." } </ span >
138138 </ div >
139139 </ Resizable >
140- < ResizableBox className = "box absolutely-positioned top-aligned right-aligned" height = { 200 } width = { 200 } resizeHandles = { [ 'sw' , 'w ' , 's' ] } >
140+ < ResizableBox className = "box absolutely-positioned top-aligned right-aligned" height = { 200 } width = { 200 } resizeHandles = { [ 'sw' , 'se' , 'nw' , 'ne' , 'w' , 'e' , 'n ', 's' ] } >
141141 < span className = "text" > Top-right Aligned</ span >
142142 </ ResizableBox >
143- < ResizableBox className = "box absolutely-positioned bottom-aligned right-aligned" height = { 200 } width = { 200 } resizeHandles = { [ 'nw' , 'w' , 'n ' ] } >
143+ < ResizableBox className = "box absolutely-positioned bottom-aligned right-aligned" height = { 200 } width = { 200 } resizeHandles = { [ 'sw' , 'se' , ' nw', 'ne' , ' w', 'e' , 'n' , 's '] } >
144144 < span className = "text" > Bottom-right Aligned</ span >
145145 </ ResizableBox >
146146 </ div >
147147
148+ < h3 > Scaled Absolute Layout</ h3 >
149+ < div >
150+ < small >
151+ If you are nesting Resizables in an element with < code > transform: scale(n)</ code > , be sure to pass the same < code > n</ code >
152+ as the < code > transformScale</ code > property.
153+ < br />
154+ This box has scale 0.75.
155+ </ small >
156+ </ div >
157+ < div className = "layoutRoot absoluteLayout scaledLayout" >
158+ < ResizableBox className = "box absolutely-positioned top-aligned left-aligned" width = { 200 } height = { 200 } resizeHandles = { [ 'sw' , 'se' , 'nw' , 'ne' , 'w' , 'e' , 'n' , 's' ] } >
159+ < span className = "text" > { "<ResizableBox> with incorrect scale 1" } </ span >
160+ </ ResizableBox >
161+
162+ < ResizableBox className = "box absolutely-positioned bottom-aligned left-aligned" width = { 200 } height = { 200 } transformScale = { 0.75 } resizeHandles = { [ 'sw' , 'se' , 'nw' , 'ne' , 'w' , 'e' , 'n' , 's' ] } >
163+ < span className = "text" > { "<ResizableBox> with correct scale 0.75" } </ span >
164+ </ ResizableBox >
165+
166+ { /* See implementation of `onResizeAbsolute` for how this can be moved around its container */ }
167+ < Resizable
168+ className = "box absolutely-positioned"
169+ height = { this . state . absoluteHeight }
170+ width = { this . state . absoluteWidth }
171+ onResize = { this . onResizeAbsolute }
172+ transformScale = { 0.75 }
173+ resizeHandles = { [ 'sw' , 'se' , 'nw' , 'ne' , 'w' , 'e' , 'n' , 's' ] }
174+ >
175+ < div
176+ style = { {
177+ width : this . state . absoluteWidth ,
178+ height : this . state . absoluteHeight ,
179+ margin : `${ this . state . absoluteTop } 0 0 ${ this . state . absoluteLeft } ` ,
180+ } }
181+ >
182+ < span className = "text" > { "Raw use of <Resizable> element with controlled position. Resize and reposition in all directions." } </ span >
183+ </ div >
184+ </ Resizable >
185+
186+ < ResizableBox className = "box absolutely-positioned top-aligned right-aligned" width = { 200 } height = { 200 } transformScale = { 0.75 } resizeHandles = { [ 'sw' , 'se' , 'nw' , 'ne' , 'w' , 'e' , 'n' , 's' ] } >
187+ < span className = "text" > { "<ResizableBox> with correct scale 0.75" } </ span >
188+ </ ResizableBox >
189+
190+ < ResizableBox className = "box absolutely-positioned bottom-aligned right-aligned" width = { 200 } height = { 200 } transformScale = { 0.75 } resizeHandles = { [ 'sw' , 'se' , 'nw' , 'ne' , 'w' , 'e' , 'n' , 's' ] } >
191+ < span className = "text" > { "<ResizableBox> with correct scale 0.75" } </ span >
192+ </ ResizableBox >
193+ </ div >
194+
148195 </ div >
149196 ) ;
150197 }
0 commit comments