#9154 closed patch
GSoC: GUI: Caret blink shaves pixels [...] (bug #2951681)
Reported by: | SF/vgvgf | Owned by: | lordhoto |
---|---|---|---|
Priority: | normal | Component: | GUI |
Version: | Keywords: | ||
Cc: | Game: |
Description
Proposed patch for bug number 2951681 "GUI: Caret blink shaves pixels from the letter underneath"
The problem is in ThemeEngine::drawCaret and EditableWidget::drawCaret. When erasing the cursor caret, ThemeEngine::drawCaret only restores the background of the widget but not the character that was affected by the cursor.
My proposed solution is to draw again the char affected by the cursor in EditableWidget::drawCaret when erasing the cursor. This way the text is restored when the cursor blinks.
Ticket imported from: #2980691. Ticket imported from: patches/1259.
Attachments (2)
Change History (7)
by , 15 years ago
Attachment: | editalbe.cpp.patch added |
---|
comment:1 by , 15 years ago
Thanks for your patch. It works fine for me.
Two remarks though:
1) That cast from char to GUI::EditableWidget::String looks a bit strange. Any reason you are not using the constructor taking a char like this: "GUI::EditableWidget::String chr(_editString[_caretPos]);"?
2) The "chr_w" variable is not named according to our standards (http://wiki.scummvm.org/index.php/Code_Formatting_Conventions)
comment:2 by , 15 years ago
1) I didn't realize that, I am still learning the project structure, but I should have researched a bit more.
2)My bad, I have read the ScummVM coding convention, but I am used to underscores for names from other projects. I won't make the same mistake again.
I have uploaded an improved patch, where both issues are fixed. However, there are not big changes.
comment:3 by , 15 years ago
Owner: | set to |
---|---|
Status: | new → closed |
comment:4 by , 15 years ago
Thank you for the patch, I just committed it.
I also noticed another minor thing, we have "uint" so I changed that "unsigned int" use to "uint".
Btw. of course those are minor changes, but that's just to get you used to our conventions.
comment:5 by , 6 years ago
Component: | → GUI |
---|
Proposed patch for bug #2951681