View Issue Details

IDProjectCategoryView StatusLast Update
0017976ScribusCanvaspublic2026-09-24 21:26
Reporterbuttar Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSFedora WorkstationOS Version44
Product Version1.7.4.svn 
Fixed in Version1.6.7.svn 
Summary0017976: Scrolling or zooming leaves stale cursor markers on rulers
Description# Issue
- Scrolling or zooming can leave a displaced copy of the red cursor marker on the horizontal and vertical rulers.
- The stale marker remains until its area is repainted.
- The cause is a mix of canvas and ruler-local coordinates in the marker state and paint path.

# Fix
- Store and paint the marker in ruler-local coordinates.
- Remove the scroll-offset translation from marker painting.
- Repaint the combined old and new marker regions.
- Preserve the existing ruler API and callers.
Steps To Reproduce- Open a document with rulers visible.
- Leave the pointer stationary over the canvas.
- Scroll horizontally or vertically, or zoom in or out.
- Observe a displaced ruler marker remaining visible.
TagsNo tags attached.
Attached Files
ruler-cursor-marker-repaint-v1.00.patch (2,074 bytes)   
Index: scribus/ui/hruler.cpp
===================================================================
--- scribus/ui/hruler.cpp	(revision 27829)
+++ scribus/ui/hruler.cpp	(working copy)
@@ -753,7 +753,6 @@
 	cr.setPoints(3, m_whereToDraw, 5, m_whereToDraw + 2, 0, m_whereToDraw - 2, 0);
 
 	p.resetTransform();
-	p.translate(-m_view->contentsX(), 0);
 	p.setPen(markerColor);
 	p.drawLine(m_whereToDraw, 0, m_whereToDraw, bottomline);
 	p.setRenderHints(QPainter::Antialiasing, true);
@@ -939,13 +938,12 @@
 
 void Hruler::draw(int where)
 {
-	// erase old marker
-	int currentCoor = where - m_view->contentsX();
-	m_whereToDraw = where;
-	m_drawMark = true;
-	repaint(m_oldMark - 4, 0, 8, bottomline);
-	//	m_drawMark = false;
+	const int currentCoor = where - m_view->contentsX();
+	const int oldCoor = m_oldMark;
+	m_whereToDraw = currentCoor;
 	m_oldMark = currentCoor;
+	m_drawMark = true;
+	update(QRect(oldCoor - 4, 0, 8, bottomline).united(QRect(currentCoor - 4, 0, 8, bottomline)));
 }
 
 void Hruler::setItem(PageItem * item)
Index: scribus/ui/vruler.cpp
===================================================================
--- scribus/ui/vruler.cpp	(revision 27829)
+++ scribus/ui/vruler.cpp	(working copy)
@@ -124,8 +124,6 @@
 		QPolygon cr;
 		cr.setPoints(3,  5, m_whereToDraw, 0, m_whereToDraw + 2, 0, m_whereToDraw - 2);
 
-	//	p.resetTransform();
-		p.translate(0, -m_view->contentsY());
 		p.setPen(markerColor);
 		p.drawLine(0, m_whereToDraw, bottomline, m_whereToDraw);
 		p.setRenderHints(QPainter::Antialiasing, true);
@@ -297,13 +295,12 @@
 
 void Vruler::draw(int where)
 {
-	// erase old marker
-	int currentCoor = where - m_view->contentsY();
-	m_whereToDraw = where;
-	m_drawMark = true;
-	repaint(0, m_oldMark - 4, bottomline, 8);
-//	m_drawMark = false;
+	const int currentCoor = where - m_view->contentsY();
+	const int oldCoor = m_oldMark;
+	m_whereToDraw = currentCoor;
 	m_oldMark = currentCoor;
+	m_drawMark = true;
+	update(QRect(0, oldCoor - 4, bottomline, 8).united(QRect(0, currentCoor - 4, bottomline, 8)));
 }
 
 void Vruler::unitChange()
PatchYes

Activities

buttar

2026-09-12 11:15

reporter   ~0054454

Might be hard to see since it is a very thin line but it is here. I hope you could reproduce as well.

buttar

2026-09-12 11:16

reporter   ~0054455

First notice on the vertical ruler (vertical scrolling) then on the horizontal, and then is zooming

jghali

2026-09-24 21:26

administrator   ~0054495

Patch applied with a small additional fix. Thanks!

Issue History

Date Modified Username Field Change
2026-09-12 11:14 buttar New Issue
2026-09-12 11:14 buttar Tag Attached: #please_test
2026-09-12 11:14 buttar File Added: ruler-cursor-marker-repaint-v1.00.patch
2026-09-12 11:15 buttar Note Added: 0054454
2026-09-12 11:15 buttar File Added: ruler-cursor-marker-repaint-issue.mp4
2026-09-12 11:16 buttar Note Added: 0054455
2026-09-24 21:25 jghali Summary [tiny patch] Scrolling or zooming leaves stale cursor markers on rulers => Scrolling or zooming leaves stale cursor markers on rulers
2026-09-24 21:25 jghali Tag Detached: #please_test
2026-09-24 21:26 jghali Note Added: 0054495
2026-09-24 21:26 jghali Assigned To => jghali
2026-09-24 21:26 jghali Status new => resolved
2026-09-24 21:26 jghali Resolution open => fixed
2026-09-24 21:26 jghali Fixed in Version => 1.6.7.svn