Re: [UFO-devel] UTextEdit reacting strangely
Status: Beta
Brought to you by:
schmidtjf
From: Elie `w. B. <dro...@gm...> - 2006-04-28 16:16:44
|
Hello there, Relating to the "mouse click selects crap" problem: I tried to focus a bit on this problem, and provide some fix. I'm strugglin= g to find the problem. The position returned when clicking the mouse is perfectly correct, but the line is wrong. I think the problem is in utextlayout.cpp, in method UTextLayout::viewToModel(pos), since it's iterating on lines from the beginning of the text. Offset should be adjusted on the displayed text start instead of the absolute text start, but isn't for some reason. I wasn't able to find the displayed text start (should be a "line offset"). If I knew where to find it, I think I could probably patch this in order to get the mouse selection work probably. Please note that the (only) way I change the displayed text start is to add enough text in the TextEdit, then move the caret down using arrow keys. I don't understand how the text manages to scroll correctly when the caret moves. I'm looking for some more insight, since I spent already most of the day crawling in the code without much success. Side note: In utextlayout.hpp, line 50, shouldn't "public" be "private". Writing "public" twice doesn't issue a warning, but what's the point in writing property-like methods if the members are publicly available. As always, thanks in advance ... -- { drozofil -- www.lwo-lab.net } |