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

List:       kde-commits
Subject:    koffice/kpresenter
From:       David Faure <faure () kde ! org>
Date:       2004-03-29 20:30:55
Message-ID: 20040329203055.166D9990E () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

Fixes for vertical alignment of text (#72224); small speed fixes.


  M +11 -10    kptextobject.cc   1.413


--- koffice/kpresenter/kptextobject.cc  #1.412:1.413
@@ -1547,5 +1547,5 @@ void KPTextObject::slotAfterFormatting( 
             double pageBottom = p.ptHeight - p.ptBottom;
             double newBottom = QMIN( wantedPosition, pageBottom ); // don't grow \
                bigger than the page
-            newBottom = QMAX( newBottom, getRect().top() ); // avoid negative \
heights +            newBottom = QMAX( newBottom, getOrig().y() ); // avoid negative \
                heights
             //kdDebug(33001) << k_funcinfo << " current bottom=" << \
getRect().bottom() << " newBottom=" << newBottom << endl;  if ( getRect().bottom() != \
newBottom ) @@ -1553,5 +1553,5 @@ void KPTextObject::slotAfterFormatting( 
                 // We resize the text object, but skipping the KPTextObject::setSize \
code  // (which invalidates everything etc.)
-                KPObject::setSize( getRect().width(), newBottom - getRect().top() );
+                KPObject::setSize( getSize().width(), newBottom - getOrig().y() );
                 // Do recalculate the new available height though
                 slotAvailableHeightNeeded();
@@ -1657,10 +1657,10 @@ KoRect KPTextObject::innerRect() const
 double KPTextObject::innerWidth() const
 {
-    return getRect().width() - bLeft() - bRight();
+    return getSize().width() - bLeft() - bRight();
 }
 
 double KPTextObject::innerHeight() const
 {
-    return getRect().height() - bTop() - bBottom();
+    return getSize().height() - bTop() - bBottom();
 }
 
@@ -1673,12 +1673,13 @@ void KPTextObject::setVerticalAligment( 
 void KPTextObject::recalcVerticalAlignment()
 {
-    double txtHeight = m_doc->zoomHandler()->layoutUnitPtToPt( \
                textDocument()->height() ) + btop + bbottom;
-    double diffy = getRect().height() - txtHeight;
+    double txtHeight = m_doc->zoomHandler()->layoutUnitPtToPt( \
m_doc->zoomHandler()->pixelYToPt( textDocument()->height() ) ) + btop + bbottom; +    \
double diffy = getSize().height() - txtHeight;  
-    //kdDebug(33001) << k_funcinfo << "txtHeight: " << txtHeight << endl;
-    //kdDebug(33001) << k_funcinfo << "diffy: " << diffy << endl;
+    //kdDebug(33001) << k_funcinfo << "txtHeight: " << txtHeight << " rectHeight:" \
<< getSize().height() << " -> diffy=" << diffy << endl;  
-    if ( diffy <= 0.0 )
+    if ( diffy <= 0.0 ) {
+        alignVertical = 0.0;
         return;
+    }
     switch( m_textVertAlign )
     {
@@ -1855,5 +1856,5 @@ void KPTextView::ensureCursorVisible()
     int w = 1;
     KPresenterDoc *doc= m_kptextobj->kPresenterDocument();
-    KoPoint pt= kpTextObject()->getRect().topLeft();
+    KoPoint pt= kpTextObject()->getOrig();
     pt.setX( doc->zoomHandler()->layoutUnitPtToPt( doc->zoomHandler()->pixelXToPt( \
                x) ) +pt.x());
     pt.setY( doc->zoomHandler()->layoutUnitPtToPt( doc->zoomHandler()->pixelYToPt( y \
))+pt.y() );


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

Configure | About | News | Add a list | Sponsored by KoreLogic