Opened 9 years ago

Closed 9 years ago

Last modified 10 months ago

#9154 closed patch

GSoC: GUI: Caret blink shaves pixels [...] (bug #2951681)

Reported by: SF/vgvgf Owned by: lordhoto
Priority: normal Component: GUI
Keywords: Cc:


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)

editalbe.cpp.patch (719 bytes) - added by SF/vgvgf 9 years ago.
Proposed patch for bug #2951681
editable.cpp.patch (709 bytes) - added by SF/vgvgf 9 years ago.
Improved patch for bug #2951681

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by SF/vgvgf

Attachment: editalbe.cpp.patch added

Proposed patch for bug #2951681

comment:1 Changed 9 years ago by lordhoto

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 (

Changed 9 years ago by SF/vgvgf

Attachment: editable.cpp.patch added

Improved patch for bug #2951681

comment:2 Changed 9 years ago by SF/vgvgf

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

I have uploaded an improved patch, where both issues are fixed. However,
there are not big changes.

comment:3 Changed 9 years ago by lordhoto

Owner: set to lordhoto
Status: newclosed

comment:4 Changed 9 years ago by lordhoto

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 Changed 10 months ago by digitall

Component: GUI
Note: See TracTickets for help on using tickets.