[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: kpresenter patch
From: Thorsten Zachmann <t.zachmann () zagge ! de>
Date: 2004-01-05 11:44:12
Message-ID: 200401051244.12751.t.zachmann () zagge ! de
[Download RAW message or body]
Hello all,
I found a problem in the snap to grid function in kpresenter. To reproduce.
1. Turn on Snap to Grid
2. Make sure to have a zoom level set so that not the whole page can be shown.
3. scroll right or down on the canvas.
4. insert a object
The object is insert to low or to much on the right.
The attached patch solves the problem. The patch is against the 1.3 branch.
Please review. I will also correct it on the head branch.
Is it ok to commit?
Have a nice day
Thorsten
["patch_grip" (text/x-diff)]
Index: kprcanvas.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kprcanvas.cc,v
retrieving revision 1.377.2.1
diff -u -3 -p -r1.377.2.1 kprcanvas.cc
--- kprcanvas.cc 17 Dec 2003 11:46:45 -0000 1.377.2.1
+++ kprcanvas.cc 5 Jan 2004 11:34:28 -0000
@@ -573,7 +573,7 @@ void KPrCanvas::mousePressEvent( QMouseE
oldMx = contentsPoint.x();
oldMy = contentsPoint.y();
- QPoint rasterPoint=applyGrid( contentsPoint,false );
+ QPoint rasterPoint=applyGrid( e->pos(), true );
resizeObjNum = 0L;
@@ -6935,7 +6935,10 @@ QPoint KPrCanvas::applyGrid( const QPoin
newPos = m_view->kPresenterDoc()->zoomHandler()->unzoomPoint( pos );
newPos.setX( static_cast<int>( newPos.x() / gridX ) * gridX );
newPos.setY( static_cast<int>( newPos.y() / gridY ) * gridY );
- return m_view->kPresenterDoc()->zoomHandler()->zoomPoint( newPos );
+ QPoint point( m_view->kPresenterDoc()->zoomHandler()->zoomPoint( newPos ) );
+ if ( offset )
+ point -= QPoint( diffx(), diffy() );
+ return point;
}
int KPrCanvas::applyGridOnPosX( int pos ) const
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic