r16089 by jghali - #9585: horizontal ruler markers misplacement
scribus-commit
scribus-commit at lists.scribus.net
Mon Dec 13 20:37:53 CET 2010
Author: jghali
Date: Mon Dec 13 19:37:53 2010
New Revision: 16089
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16089
Log:
#9585: horizontal ruler markers misplacement
Modified:
branches/Version135/Scribus/scribus/hruler.cpp
Modified: branches/Version135/Scribus/scribus/hruler.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16089&path=/branches/Version135/Scribus/scribus/hruler.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/hruler.cpp (original)
+++ branches/Version135/Scribus/scribus/hruler.cpp Mon Dec 13 19:37:53 2010
@@ -115,12 +115,12 @@
int Hruler::textPosToLocal(double x) const
{
- return qRound(textPosToCanvas(x) * Scaling);
+ return qRound(textPosToCanvas(x) * Scaling) - currView->contentsX();
}
double Hruler::localToTextPos(int x) const
{
- return x/Scaling - textBase();
+ return ((x + currView->contentsX()) / Scaling - textBase());
}
void Hruler::shift(double pos)
@@ -512,16 +512,18 @@
if (textEditMode)
{
- p.eraseRect(QRect(QPoint(qRound((ItemPos+Extra)*sc), 1), QPoint(qRound((ItemEndPos-RExtra)*sc), 15)));
- p.drawLine(qRound((ItemPos+Extra)*sc), 16, qRound((ItemEndPos-RExtra)*sc), 16);
+ int rectX1 = textPosToLocal(Extra);
+ int rectX2 = textPosToLocal(ItemEndPos-ItemPos-RExtra);
+ p.eraseRect(QRect(QPoint(rectX1, 1), QPoint(rectX2, 15)));
+ p.drawLine(rectX1, 16, rectX2, 16);
p.save();
p.setRenderHints(QPainter::Antialiasing, true);
if (Revers)
{
- p.translate(qRound((ItemPos)*sc), 0);
+ p.translate( textPosToLocal(0), 0);
p.scale(-1, 1);
- p.translate(qRound((ItemPos+Extra)*sc-(ItemEndPos-RExtra)*sc), 0);
- p.translate(-qRound(ItemPos*sc), 0);
+ p.translate( textPosToLocal(Extra) - textPosToLocal(ItemEndPos-ItemPos-RExtra), 0);
+ p.translate(-textPosToLocal(0), 0);
}
for (int CurrCol = 0; CurrCol < Cols; ++CurrCol)
{
More information about the scribus-commit
mailing list