mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-29 18:14:16 +00:00
Fixed an old off-by-one error in Text::BreakLines, and updated
DialogOverlay appropriately.
This commit is contained in:
parent
c9945d5af8
commit
935bf6833a
@ -149,7 +149,9 @@ void DialogOverlay::RecalculateSize() {
|
|||||||
this->width = std::max(0, Screen::GetWidth() - (HORIZONTAL_PADDING * 2));
|
this->width = std::max(0, Screen::GetWidth() - (HORIZONTAL_PADDING * 2));
|
||||||
|
|
||||||
if (lastWidth != this->width) {
|
if (lastWidth != this->width) {
|
||||||
messageLines = text::BreakLines(this->message, this->width - 3);
|
/* 4 here: 2 for the frame padding (left/right), then two for the
|
||||||
|
inner content padding so things aren't bunched up (left/right) */
|
||||||
|
messageLines = text::BreakLines(this->message, this->width - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->height = 0; /* top padding */
|
this->height = 0; /* top padding */
|
||||||
|
@ -190,7 +190,7 @@ namespace cursespp {
|
|||||||
|
|
||||||
/* we have enough space for this new word. accumulate it. */
|
/* we have enough space for this new word. accumulate it. */
|
||||||
|
|
||||||
if (accumLength + extra + wordLength < width) {
|
if (accumLength + extra + wordLength <= width) {
|
||||||
if (extra) {
|
if (extra) {
|
||||||
accum += " ";
|
accum += " ";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user