[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: [Bug 112310] JJ: Most basic resizing operation for pictures are not
From: T Zachmann <t.zachmann () zagge ! de>
Date: 2006-03-06 15:20:19
Message-ID: 20060306152019.21576.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.kde.org/show_bug.cgi?id=112310
t.zachmann zagge de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From t.zachmann zagge de 2006-03-06 16:20 -------
SVN commit 516290 by zachmann:
o Fix: Make it possible to resize objects around the center.
See: http://www.koffice.org/developer/keyboardmodifiers.php for the
possible actions.
BUG: 112310
M +54 -4 KPrCanvas.cpp
M +1 -1 KPrCanvas.h
--- trunk/koffice/kpresenter/KPrCanvas.cpp #516289:516290
@ -1501,8 +1501,13 @
{
keepRatio = true;
}
+ bool scaleAroundCenter = false;
+ if ( e->state() & ControlButton )
+ {
+ scaleAroundCenter = true;
+ }
- resizeObject( modType, sp, keepRatio );
+ resizeObject( modType, sp, keepRatio, scaleAroundCenter );
}
} break;
case TEM_ZOOM : {
@ -2108,7 +2113,7 @
m_gl.repaintAfterSnapping();
}
// undo snapping for move by mouse
- if ( e->state() & Qt::LeftButton )
+ if ( e->state() & Qt::LeftButton && m_isMoving )
{
moveObjectsByMouse( m_origMousePos, e->state() & AltButton \
|| e->state() & ControlButton ); }
@ -4715,7 +4720,7 @
}
-void KPrCanvas::resizeObject( ModifyType _modType, const KoPoint & point, bool \
keepRatio ) +void KPrCanvas::resizeObject( ModifyType _modType, const KoPoint & \
point, bool keepRatio, bool scaleAroundCenter ) {
KPrObject *kpobject = m_resizeObject;
@ -4837,10 +4842,55 @
}
else
{
- newRight = objRect.right() + width;
+ newRight = objRect.left() + width;
}
}
+ if ( scaleAroundCenter )
+ {
+ KoPoint center( m_rectBeforeResize.center() );
+
+ if ( newLeft != objRect.left() )
+ {
+ width = 2 * ( center.x() - newLeft );
+ }
+ else if ( newRight != objRect.right() )
+ {
+ width = 2 * ( newRight - center.x() );
+ }
+
+ // if keep ratio is set caluclate witdh by ratio
+ if ( keepRatio )
+ {
+ height = width / m_ratio;
+ }
+ else
+ {
+ if ( newTop != objRect.top() )
+ {
+ height = 2 * ( center.y() - newTop );
+ }
+ else if ( newBottom != objRect.bottom() )
+ {
+ height = 2 * ( newBottom - center.y() );
+ }
+ }
+
+ if ( width < MIN_SIZE )
+ {
+ width = MIN_SIZE;
+ }
+ if ( height < MIN_SIZE )
+ {
+ height = MIN_SIZE;
+ }
+
+ newLeft = center.x() - width / 2;
+ newRight = newLeft + width;
+ newTop = center.y() - height / 2;
+ newBottom = newTop + height;
+ }
+
if ( newLeft != objRect.left() || newRight != objRect.right() || newTop != \
objRect.top() || newBottom != objRect.bottom() ) {
// resizeBy and moveBy have to been used to make it work with rotated \
objects
--- trunk/koffice/kpresenter/KPrCanvas.h #516289:516290
@ -628,7 +628,7 @
//---- stuff needed for resizing ----
/// resize the m_resizeObject
- void resizeObject( ModifyType _modType, const KoPoint & point, bool keepRatio );
+ void resizeObject( ModifyType _modType, const KoPoint & point, bool keepRatio, \
bool scaleAroundCenter ); /// create KPrResizeCmd
void finishResizeObject( const QString &name, bool layout = true );
_______________________________________________
koffice-devel mailing list
koffice-devel@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