Skip to content

Commit

Permalink
fix #669: dmledit crash on resize (#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
xucs007 authored Aug 1, 2023
1 parent f33e0d2 commit 9e263cd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/dlangui/widgets/layouts.d
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,14 @@ class ResizerWidget : Widget {
private void resizeAndFireEvent(short newWidth, ResizerEventType type)
{
// Respect the dimensions
if(newWidth > minPreviousItemWidth && newWidth < (parent.width - minWidth - minNextItemWidth) &&
newWidth > _previousWidget.minWidth() && newWidth < (parent.width - minWidth - _nextWidget.minWidth()))
if( (newWidth > minPreviousItemWidth) && (newWidth < (parent.width - minWidth - minNextItemWidth)) && (_previousWidget is null ||
( (newWidth > _previousWidget.minWidth) &&
(newWidth < (parent.width - minWidth - _nextWidget.minWidth))
)))
{
_previousWidget.layoutWidth = newWidth;
if (_previousWidget !is null) {
_previousWidget.layoutWidth = newWidth;
}
if (resizeEvent.assigned)
{
resizeEvent(this, type, newWidth);
Expand Down

0 comments on commit 9e263cd

Please sign in to comment.