mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] RoundCursorView: fix potential black trail when redrawing
cursor (issue #1458 on GitHub)
This commit is contained in:
@@ -68,37 +68,9 @@ bool RoundCursorView::eraseCursorIfPossible() {
|
||||
// Erase the cursor
|
||||
KDColor cursorWorkingBuffer[k_cursorSize * k_cursorSize];
|
||||
KDContext * ctx = KDIonContext::sharedContext();
|
||||
ctx->setOrigin(currentFrame.origin());
|
||||
ctx->setOrigin(absoluteOrigin());
|
||||
ctx->setClippingRect(currentFrame);
|
||||
KDSize cursorSize = KDSize(k_cursorSize, k_cursorSize);
|
||||
|
||||
/* We assert that the visible frame is not cropped (indeed a cursor is always
|
||||
* fully inside the window, thanks to panToMakeCursorVisible). Otherwise, we
|
||||
* would need to change this algorithm.
|
||||
*
|
||||
* +---+
|
||||
* | |<- frame m_underneathPixelBuffer: +---+
|
||||
* +----+---+--------+ |000|
|
||||
* | |xxx| |<- parentVisibleFrame |xxx|
|
||||
* | +---+ | +---+
|
||||
* | |
|
||||
* +-----------------+
|
||||
*
|
||||
* +---+
|
||||
* |xxx|: absoluteVisibleFrame
|
||||
* +---+
|
||||
*
|
||||
* What we would draw with the current algorithm:
|
||||
* +---+
|
||||
* | |<- frame
|
||||
* +----+---+--------+
|
||||
* | |000| |<- parentVisibleFrame
|
||||
* | +---+ |
|
||||
* | |
|
||||
* +-----------------+
|
||||
*
|
||||
* */
|
||||
assert(currentFrame.size() == cursorSize);
|
||||
ctx->fillRectWithPixels(KDRect(0, 0, cursorSize), m_underneathPixelBuffer, cursorWorkingBuffer);
|
||||
// TODO Restore the context to previous values?
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user