@@ -197,22 +197,21 @@ export default abstract class Shape extends Observable {
197197 if ( ! this . handleAlignment ) {
198198 const availableWidth = Utils . layout . toDevicePixels ( canvas . getWidth ( ) ) ;
199199 const availableHeight = Utils . layout . toDevicePixels ( canvas . getHeight ( ) ) ;
200- const paddingLeft = parent . effectivePaddingLeft + Utils . layout . toDeviceIndependentPixels ( parent . effectiveBorderLeftWidth ) ;
201- const paddingRight = parent . effectivePaddingRight + Utils . layout . toDeviceIndependentPixels ( parent . effectiveBorderRightWidth ) ;
202-
203- const paddingTop = parent . effectivePaddingTop + Utils . layout . toDeviceIndependentPixels ( parent . effectiveBorderTopWidth ) ;
204- const paddingBottom = parent . effectivePaddingBottom + Utils . layout . toDeviceIndependentPixels ( parent . effectiveBorderBottomWidth ) ;
200+ const paddingLeft = Utils . layout . toDeviceIndependentPixels ( parent . effectivePaddingLeft ) + Utils . layout . toDeviceIndependentPixels ( parent . effectiveBorderLeftWidth ) ;
201+ const paddingRight = Utils . layout . toDeviceIndependentPixels ( parent . effectivePaddingRight ) + Utils . layout . toDeviceIndependentPixels ( parent . effectiveBorderRightWidth ) ;
202+ const paddingTop = Utils . layout . toDeviceIndependentPixels ( parent . effectivePaddingTop ) + Utils . layout . toDeviceIndependentPixels ( parent . effectiveBorderTopWidth ) ;
203+ const paddingBottom = Utils . layout . toDeviceIndependentPixels ( parent . effectivePaddingBottom ) + Utils . layout . toDeviceIndependentPixels ( parent . effectiveBorderBottomWidth ) ;
205204 canvas . save ( ) ;
206205 if ( paddingLeft > 0 ) {
207206 canvas . translate ( paddingLeft , 0 ) ;
208207 }
209- if ( paddingRight > 0 ) {
208+ if ( this . horizontalAlignment && this . horizontalAlignment !== 'left' && paddingRight > 0 ) {
210209 canvas . translate ( - paddingRight , 0 ) ;
211210 }
212211 if ( paddingTop > 0 ) {
213212 canvas . translate ( 0 , paddingTop ) ;
214213 }
215- if ( paddingBottom > 0 ) {
214+ if ( this . verticalAlignment && this . verticalAlignment !== 'top' && paddingBottom > 0 ) {
216215 canvas . translate ( 0 , - paddingBottom ) ;
217216 }
218217 if ( this . horizontalAlignment === 'right' ) {
0 commit comments