@@ -159,18 +159,24 @@ private Thumb GetResizeThumb(Cursor cur, HorizontalAlignment hor, VerticalAlignm
159
159
if ( newHeight > 0 && top <= canvas . ActualHeight )
160
160
{
161
161
element . Height = newHeight ;
162
- ScaleWidth ( thumb , element , newHeight ) ;
162
+ if ( _isRatioScale )
163
+ ScaleWidth ( thumb , element , newHeight ) ;
163
164
}
164
165
}
165
166
break ;
166
167
167
168
case VerticalAlignment . Top :
168
169
if ( element . Height - e . VerticalChange > MINIMAL_SIZE )
169
170
{
170
-
171
171
var newHeight = element . Height - e . VerticalChange ;
172
172
var top = Canvas . GetTop ( element ) ;
173
- ScaleWidth ( thumb , element , newHeight ) ;
173
+ if ( newHeight > 0 && top + e . VerticalChange >= 0 )
174
+ {
175
+ element . Height = newHeight ;
176
+ Canvas . SetTop ( element , top + e . VerticalChange ) ;
177
+ if ( _isRatioScale )
178
+ ScaleWidth ( thumb , element , newHeight ) ;
179
+ }
174
180
}
175
181
176
182
break ;
@@ -187,7 +193,8 @@ private Thumb GetResizeThumb(Cursor cur, HorizontalAlignment hor, VerticalAlignm
187
193
{
188
194
element . Width = newWidth ;
189
195
Canvas . SetLeft ( element , left + e . HorizontalChange ) ;
190
- ScaleHeight ( thumb , element , newWidth ) ;
196
+ if ( _isRatioScale )
197
+ ScaleHeight ( thumb , element , newWidth ) ;
191
198
}
192
199
}
193
200
@@ -200,7 +207,8 @@ private Thumb GetResizeThumb(Cursor cur, HorizontalAlignment hor, VerticalAlignm
200
207
if ( newWidth > 0 && left <= canvas . ActualWidth )
201
208
{
202
209
element . Width = newWidth ;
203
- ScaleHeight ( thumb , element , newWidth ) ;
210
+ if ( _isRatioScale )
211
+ ScaleHeight ( thumb , element , newWidth ) ;
204
212
}
205
213
}
206
214
break ;
0 commit comments