bool BookTextView::_onStylusRelease(int x, int y) { FBReader &fbreader = FBReader::Instance(); if (!isReleasedWithoutMotion()) { return false; } const ZLTextElementRectangle *rectangle = textArea().elementByCoordinates(x, y); if (rectangle != 0) { std::string id; ZLHyperlinkType type; if (getHyperlinkInfo(*rectangle, id, type)) { fbreader.tryShowFootnoteView(id, type); return true; } if (fbreader.isDictionarySupported() && fbreader.EnableSingleClickDictionaryOption.value()) { const std::string txt = word(*rectangle); if (!txt.empty()) { fbreader.openInDictionary(txt); return true; } } } return false; }
bool FBView::onStylusRelease(int x, int y) { if (ZLTextView::onStylusRelease(x, y)) { return true; } if (_onStylusRelease(x, y)) { return true; } myIsReleasedWithoutMotion = myIsReleasedWithoutMotion && (abs(x - pressedX()) <= 5) && (abs(y - pressedY()) <= 5); if (isReleasedWithoutMotion() && fbreader().EnableTapScrollingOption.value() && (!ZLBooleanOption(ZLCategoryKey::EMPTY, ZLOption::PLATFORM_GROUP, ZLOption::FINGER_TAP_DETECTABLE, false).value() || !fbreader().TapScrollingOnFingerOnlyOption.value())) { doTapScrolling(y); return true; } return false; }