GRAPHICS: MACGUI: fix the scroll bar of mactextwindow, fix the incorrectly behaviour when appendText of mactextwindow #2903
Conversation
|
Good code. There sneaked in a few unnecessary whitespace changes which could be better reverted (in a separate commit is fine, but if you feel adventurous, you could change the relevant commits). |
graphics/macgui/mactext.cpp
Outdated
@@ -485,12 +494,12 @@ void MacText::splitString(const Common::U32String &str, int curLine) { | |||
|
|||
for (int i = 1; i < (int)word.size(); i++) { | |||
word_width += word[i].getFont()->getStringWidth(word[i].text); | |||
D(9, "** word \"%s\" textslant [%d]", Common::toPrintable(word[i].text.encode()).c_str(), word[i].textSlant); |
sev-
Mar 31, 2021
Member
Please revert this, I had more debug info than you do.
Please revert this, I had more debug info than you do.
graphics/macgui/mactext.cpp
Outdated
@@ -733,6 +747,11 @@ int MacText::getLineCharWidth(int line, bool enforce) { | |||
return width; | |||
} | |||
|
|||
int MacText::getLastLineWidth() { | |||
if (_textLines.size() == 0) return 0; |
sev-
Mar 31, 2021
Member
Please make it two lines.
Please make it two lines.
graphics/macgui/mactext.cpp
Outdated
@@ -838,8 +857,7 @@ void MacText::resize(int w, int h) { | |||
} | |||
|
|||
void MacText::appendText(const Common::U32String &str, int fontId, int fontSize, int fontSlant, bool skipAdd) { | |||
appendTextDefault(str, skipAdd); | |||
|
|||
// appendTextDefault(str, skipAdd); |
sev-
Mar 31, 2021
Member
If it is not needed, perhaps you could clean it up and just remove, and remove the skipAdd
parameter?
If it is not needed, perhaps you could clean it up and just remove, and remove the skipAdd
parameter?
graphics/macgui/mactext.cpp
Outdated
@@ -850,12 +868,10 @@ void MacText::appendText(const Common::U32String &str, int fontId, int fontSize, | |||
_str += fontRun.toString(); | |||
_str += str; | |||
} | |||
|
sev-
Mar 31, 2021
Member
Why?
Why?
graphics/macgui/mactext.cpp
Outdated
splitString(str); | ||
recalcDims(); | ||
|
||
render(oldLen - 1, _textLines.size()); | ||
|
sev-
Mar 31, 2021
Member
Also, why removing this?
Also, why removing this?
graphics/macgui/mactext.cpp
Outdated
@@ -881,7 +897,6 @@ void MacText::appendTextDefault(const Common::U32String &str, bool skipAdd) { | |||
_str += _defaultFormatting.toString(); | |||
_str += str; | |||
} | |||
|
sev-
Mar 31, 2021
Member
And this
And this
graphics/macgui/mactext.cpp
Outdated
@@ -921,16 +936,16 @@ void MacText::removeLastLine() { | |||
void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) { | |||
if (_textLines.empty()) | |||
return; | |||
|
sev-
Mar 31, 2021
Member
And this was removed for no reason
And this was removed for no reason
} | ||
|
||
// draw highlight scroll bar | ||
if (_highlightedPart == kBorderScrollUp || _highlightedPart == kBorderScrollDown) { |
sev-
Mar 31, 2021
Member
Is it possible to move this to macwindowborder.cpp
?
Is it possible to move this to macwindowborder.cpp
?
graphics/macgui/macwindowmanager.cpp
Outdated
@@ -443,21 +446,53 @@ void macDrawPixel(int x, int y, int color, void *data) { | |||
uint xu = (uint)x; // for letting compiler optimize it | |||
uint yu = (uint)y; | |||
*((T)p->surface->getBasePtr(xu, yu)) = p->invert ? ~(*((T)p->surface->getBasePtr(xu, yu))) : | |||
(pat[(yu - p->fillOriginY) % 8] & (1 << (7 - (xu - p->fillOriginX) % 8))) ? color : p->bgColor; | |||
(pat[(yu - p->fillOriginY) % 8] & (1 << (7 - (xu - p->fillOriginX) % 8))) ? color : p->bgColor; |
sev-
Mar 31, 2021
Member
please revert this, this is just indentation change with no reason
please revert this, this is just indentation change with no reason
93b660d
to
3e05322
…was calc by MacGUI
…der to fix the bug of cursor dislocation and incorrectly drawing the input
…a palette of MacWindowManager
…x scroll bar for mactextwindow
…l for default palette, which is used to draw the scroll bar
…bar will also display
Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
No description provided.