Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#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)

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

Download all attachments as: .zip

Change History (7)

by SF/vgvgf, 15 years ago

Attachment: editalbe.cpp.patch added

Proposed patch for bug #2951681

comment:1 by lordhoto, 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)

by SF/vgvgf, 15 years ago

Attachment: editable.cpp.patch added

Improved patch for bug #2951681

comment:2 by SF/vgvgf, 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 lordhoto, 15 years ago

Owner: set to lordhoto
Status: newclosed

comment:4 by lordhoto, 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 digitall, 6 years ago

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