Skip to content

Commit

Permalink
Fix issue #7350: if w or h is -1, set width or height to 'auto'
Browse files Browse the repository at this point in the history
When w or h is -1, then instead of not changing width or height, it
should be set to its preferred size.
  • Loading branch information
RockinRoel committed Feb 4, 2020
1 parent c6c7500 commit 05ed470
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Wt/WPaintedWidget.C
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,12 @@ DomElement *WPaintedWidget::createDomElement(WApplication *app)
"""var u = $(self).find('canvas, img');"
"""if (w >= 0) "
"" "u.width(w);"
"""else "
"" "u.width('auto');"
"""if (h >= 0) "
"" "u.height(h);"
"""else "
"" "u.height('auto');"
"}");
}

Expand Down

0 comments on commit 05ed470

Please sign in to comment.