Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4f276486 authored by Jan Hambrecht's avatar Jan Hambrecht

fix crash when trying to resize shapes with zero width or height


svn path=/trunk/koffice/; revision=940228
parent a7e57566
......@@ -2,7 +2,7 @@
Copyright (C) 2006-2008 Thorsten Zachmann <zachmann@kde.org>
Copyright (C) 2006-2007 Thomas Zander <zander@kde.org>
Copyright (C) 2008 Jan Hambrecht <jaham@gmx.net>
Copyright (C) 2008-2009 Jan Hambrecht <jaham@gmx.net>
Copyright (C) 2008 Casper Boemann <cbr@boemann.dk>
This library is free software; you can redistribute it and/or
......
......@@ -31,6 +31,7 @@
#include <KoTool.h>
#include <klocale.h>
#include <limits>
ShapeResizeStrategy::ShapeResizeStrategy( KoTool *tool, KoCanvasBase *canvas,
const QPointF &clicked, KoFlake::SelectionHandle direction )
......@@ -104,7 +105,11 @@ void ShapeResizeStrategy::handleMouseMove(const QPointF &point, Qt::KeyboardModi
keepAspect = keepAspect || shape->keepAspectRatio();
qreal startWidth = m_initialSize.width();
if (startWidth < std::numeric_limits<qreal>::epsilon())
startWidth = std::numeric_limits<qreal>::epsilon();
qreal startHeight = m_initialSize.height();
if (startHeight < std::numeric_limits<qreal>::epsilon())
startHeight = std::numeric_limits<qreal>::epsilon();
QPointF distance = m_unwindMatrix.map(newPos) - m_unwindMatrix.map( m_start );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment