[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [PATCH] Fix for kpresenter bug #63032
From:       Peter Simonsson <psn () linux ! se>
Date:       2003-10-08 18:17:45
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 08 October 2003 06:19, Thorsten Zachmann wrote:
> Hello
>
> > > This patch should fix kpresenter bug 63032: When resizing a frame it
> > > does not snap to the grid
> > >
> > > Ok to commit?
> >
> > Yes, thanks a lot for the patch.
>
> Sorry, I didn't have time to test the patch earlier. There are some
> problems with the patch.
>
> Resizing  up, left and all combinations with left and up do not work
> correctly. This is only a copy and paste problem (wrong + -) and can easily
> be fixed (patch is attached).
>
> But if they are fixed there are still some problems. When resizing close to
> the boarder of the page there is a flickering of the old and the new
> contour of the object. Resizing up,left or down,right at the boarder is
> also not working as expected (filckering of object between object resized
> up , object resized left when resizing up left).
>
> I do not know how to fix this.
>
> I think there are two possibilities to solve this problem as the new
> behavior is not realy much better than the old one.
>
> 1. fix remaining problems (no idea at the moment how it could be done)
> 2. revert the patch
>
> What do you thing should be done.
>
Ok here's a new patch that should (hopefully ;)) fix your last problems... (it 
contains your patch too)

Ok, to commit? ( and please test before answering ;))
- -- 
LLaP
Peter Simonsson

Kivio (KOffice Flowcharting Application) - http://www.koffice.org/kivio/
Kexi - http://www.koffice.org/kexi/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/hFTNjR6JKcrOq3sRAu/SAKDos2WpYNQo3YjytKSnKhTM8FYL9QCeLwer
KuSbBACKu2uM5URJzVBRrrg=
=0urg
-----END PGP SIGNATURE-----

["kpresenter.diff" (text/x-diff)]

Index: kprcanvas.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kprcanvas.cc,v
retrieving revision 1.373
diff -u -p -r1.373 kprcanvas.cc
--- kprcanvas.cc	5 Oct 2003 18:19:29 -0000	1.373
+++ kprcanvas.cc	8 Oct 2003 18:12:32 -0000
@@ -5460,7 +5460,7 @@ void KPrCanvas::resizeObject( ModifyType
     KoSize objSize = kpobject->getSize();
     KoRect objRect=kpobject->getBoundingRect();
     KoRect pageRect=m_activePage->getPageRect();
-    KoPoint point=objRect.topLeft();
+    KoPoint point= m_origBRect.topLeft();
     QPainter p;
     p.begin( this );
     kpobject->moveBy(m_view->zoomHandler()->unzoomItX(-diffx()),m_view->zoomHandler()->unzoomItY(-diffy()));
 @@ -5468,81 +5468,82 @@ void KPrCanvas::resizeObject( ModifyType
                     (kpobject->isSelected()) && drawContour);
     switch ( _modType ) {
     case MT_RESIZE_LU: {
-        if( (point.x()+dx) <(pageRect.left()-1))
-            dx=0;
-        if( (point.y()+dy) <(pageRect.top()-1))
-            dy=0;
+        if( (point.x()+dx) < pageRect.left())
+            dx = pageRect.left() - m_view->zoomHandler()->unzoomItX(m_origPos.x());
+        if( (point.y()+dy) < pageRect.top())
+            dy = pageRect.top() - m_view->zoomHandler()->unzoomItY(m_origPos.y());
         if ( keepRatio && ratio != 0.0 )
             calcRatio( dx, dy, _modType, ratio );
-        kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() + dy);
+        kpobject->setSize(m_origBRect.width() - dx, m_origBRect.height() - dy);
         if ( objSize.width() != (kpobject->getSize()).width() )
-            kpobject->setOrig(m_origBRect.x() - dx, kpobject->getOrig().y());
+            kpobject->setOrig(m_origBRect.x() + dx, kpobject->getOrig().y());
         if ( objSize.height() != (kpobject->getSize()).height() )
-            kpobject->setOrig(kpobject->getOrig().x(), m_origBRect.y() - dy);
+            kpobject->setOrig(kpobject->getOrig().x(), m_origBRect.y() + dy);
     } break;
     case MT_RESIZE_LF: {
         dy = 0;
-        if( (point.x()+dx) <(pageRect.left()-1))
-            dx=0;
+        if( (point.x()+dx) < pageRect.left())
+            dx = pageRect.left() - m_view->zoomHandler()->unzoomItX(m_origPos.x());
         if ( keepRatio && ratio != 0.0 )
             calcRatio( dx, dy, _modType, ratio );
-        kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() + dy);
+        kpobject->setSize(m_origBRect.width() - dx, m_origBRect.height() - dy);
         if ( objSize != kpobject->getSize() )
-            kpobject->setOrig(m_origBRect.x() - dx, kpobject->getOrig().y());
+            kpobject->setOrig(m_origBRect.x() + dx, kpobject->getOrig().y());
     } break;
     case MT_RESIZE_LD: {
         if( (point.y()+objRect.height()+dy) > pageRect.height())
-            dy=0;
-        if( (point.x()+dx) <(pageRect.left()-1))
-            dx=0;
+            dy = pageRect.height() - \
m_view->zoomHandler()->unzoomItY(m_origPos.y()); +        if( (point.x()+dx) < \
pageRect.left()) +            dx = pageRect.left() - \
m_view->zoomHandler()->unzoomItX(m_origPos.x());  if ( keepRatio && ratio != 0.0 )
             calcRatio( dx, dy, _modType, ratio );
-        kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() + dy);
+        kpobject->setSize(m_origBRect.width() - dx, m_origBRect.height() + dy);
         if ( objSize.width() != (kpobject->getSize()).width() )
-            kpobject->setOrig(m_origBRect.x() - dx, kpobject->getOrig().y());
+            kpobject->setOrig(m_origBRect.x() + dx, kpobject->getOrig().y());
     } break;
     case MT_RESIZE_RU: {
         if( (point.x()+objRect.width()+dx) > pageRect.width())
-            dx=0;
-        if( (point.y()+dy) <(pageRect.top()-1))
-            dy=0;
+            dx = pageRect.width() - m_view->zoomHandler()->unzoomItX(m_origPos.x());
+        if( (point.y()+dy) < pageRect.top())
+            dy = pageRect.top() - m_view->zoomHandler()->unzoomItY(m_origPos.y());
         if ( keepRatio && ratio != 0.0 )
             calcRatio( dx, dy, _modType, ratio );
-        kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() + dy);
+        kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() - dy);
         if ( objSize.height() != (kpobject->getSize()).height() )
-            kpobject->setOrig(kpobject->getOrig().x(), m_origBRect.y() - dy);
+            kpobject->setOrig(kpobject->getOrig().x(), m_origBRect.y() + dy);
     } break;
     case MT_RESIZE_RT: {
         dy = 0;
         if( (point.x()+objRect.width()+dx) > pageRect.width())
-            dx=0;
+            dx = pageRect.width() - m_view->zoomHandler()->unzoomItX(m_origPos.x());
         if ( keepRatio && ratio != 0.0 )
             calcRatio( dx, dy, _modType, ratio );
         kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() + dy);
     } break;
     case MT_RESIZE_RD: {
         if( (point.y()+objRect.height()+dy) > pageRect.height())
-            dy=0;
+            dy = pageRect.height() - \
m_view->zoomHandler()->unzoomItY(m_origPos.y());  if( (point.x()+objRect.width()+dx) \
>                 pageRect.width())
-            dx=0;
+            dx = pageRect.width() - m_view->zoomHandler()->unzoomItX(m_origPos.x());
         if ( keepRatio && ratio != 0.0 )
             calcRatio( dx, dy, _modType, ratio );
         kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() + dy);
     } break;
     case MT_RESIZE_UP: {
         dx = 0;
-        if( (point.y()+dy) <(pageRect.top()-1))
-            dy=0;
+        if( (point.y()+dy) < pageRect.top())
+            dy = pageRect.top() - m_view->zoomHandler()->unzoomItY(m_origPos.y());
         if ( keepRatio && ratio != 0.0 )
             calcRatio( dx, dy, _modType, ratio );
-        kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() + dy);
+        kpobject->setSize(m_origBRect.width() - dx, m_origBRect.height() - dy);
         if ( objSize != kpobject->getSize() )
-            kpobject->setOrig(kpobject->getOrig().x(), m_origBRect.y() - dy);
+            kpobject->setOrig(kpobject->getOrig().x(), m_origBRect.y() + dy);
+
     } break;
     case MT_RESIZE_DN: {
         dx = 0;
         if( (point.y()+objRect.height()+dy) > pageRect.height())
-            dy=0;
+            dy = pageRect.height() - \
m_view->zoomHandler()->unzoomItY(m_origPos.y());  if ( keepRatio && ratio != 0.0 )
             calcRatio( dx, dy, _modType, ratio );
         kpobject->setSize(m_origBRect.width() + dx, m_origBRect.height() + dy);



_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://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