diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/inputwidget.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 9261da0c..aa55f3f0 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -742,15 +742,17 @@ static void startOrStopCursorTimer_InputWidget_(iInputWidget *d, int doStart) { | |||
742 | #else /* using a system-provided text control */ | 742 | #else /* using a system-provided text control */ |
743 | 743 | ||
744 | static void updateAllLinesAndResizeHeight_InputWidget_(iInputWidget *d) { | 744 | static void updateAllLinesAndResizeHeight_InputWidget_(iInputWidget *d) { |
745 | /* Rewrap the buffered text and resize accordingly. */ | 745 | if (width_Widget(d) >= minWidth_InputWidget_) { |
746 | iWrapText wt = wrap_InputWidget_(d, 0); | 746 | /* Rewrap the buffered text and resize accordingly. */ |
747 | /* TODO: Set max lines limit for WrapText. */ | 747 | iWrapText wt = wrap_InputWidget_(d, 0); |
748 | const int height = measure_WrapText(&wt, d->font).bounds.size.y; | 748 | /* TODO: Set max lines limit for WrapText. */ |
749 | /* We use this to store the number wrapped lines for determining widget height. */ | 749 | const int height = measure_WrapText(&wt, d->font).bounds.size.y; |
750 | d->visWrapLines.start = 0; | 750 | /* We use this to store the number wrapped lines for determining widget height. */ |
751 | d->visWrapLines.end = iMax(d->minWrapLines, | 751 | d->visWrapLines.start = 0; |
752 | iMin(d->maxWrapLines, height / lineHeight_Text(d->font))); | 752 | d->visWrapLines.end = iMax(d->minWrapLines, |
753 | updateMetrics_InputWidget_(d); | 753 | iMin(d->maxWrapLines, height / lineHeight_Text(d->font))); |
754 | updateMetrics_InputWidget_(d); | ||
755 | } | ||
754 | } | 756 | } |
755 | 757 | ||
756 | #endif | 758 | #endif |