зеркало из https://github.com/mozilla/gecko-dev.git
Bug 694913 Assume that user clicked on right most of a character if clicked character in composition string is zero-width r=roc+emk
This commit is contained in:
Родитель
f2d3346139
Коммит
61c6fb2f03
|
@ -2066,7 +2066,8 @@ nsIMM32Handler::ResolveIMECaretPos(nsIWidget* aReferenceWidget,
|
|||
bool
|
||||
nsIMM32Handler::OnMouseEvent(nsWindow* aWindow, LPARAM lParam, int aAction)
|
||||
{
|
||||
if (!sWM_MSIME_MOUSE || !mIsComposing) {
|
||||
if (!sWM_MSIME_MOUSE || !mIsComposing ||
|
||||
!ShouldDrawCompositionStringOurselves()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2090,8 +2091,18 @@ nsIMM32Handler::OnMouseEvent(nsWindow* aWindow, LPARAM lParam, int aAction)
|
|||
ResolveIMECaretPos(aWindow, cursorRect,
|
||||
aWindow->GetTopLevelWindow(false), cursorInTopLevel);
|
||||
PRInt32 cursorXInChar = cursorInTopLevel.x - charAtPt.mReply.mRect.x;
|
||||
int positioning = cursorXInChar * 4 / charAtPt.mReply.mRect.width;
|
||||
// The event might hit to zero-width character, see bug 694913.
|
||||
// The reason might be:
|
||||
// * There are some zero-width characters are actually.
|
||||
// * font-size is specified zero.
|
||||
// But nobody reproduced this bug actually...
|
||||
// We should assume that user clicked on right most of the zero-width
|
||||
// character in such case.
|
||||
int positioning = 1;
|
||||
if (charAtPt.mReply.mRect.width > 0) {
|
||||
positioning = cursorXInChar * 4 / charAtPt.mReply.mRect.width;
|
||||
positioning = (positioning + 2) % 4;
|
||||
}
|
||||
|
||||
int offset = charAtPt.mReply.mOffset - mCompositionStart;
|
||||
if (positioning < 2) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче