r18589 by fschmid - Fixed Item selection in groups.
scribus-commit
scribus-commit at lists.scribus.net
Sun Nov 10 23:08:13 UTC 2013
Author: fschmid
Date: Sun Nov 10 23:08:12 2013
New Revision: 18589
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18589
Log:
Fixed Item selection in groups.
Modified:
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/canvas.h
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18589&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Sun Nov 10 23:08:12 2013
@@ -454,7 +454,7 @@
if (currItem->isGroup() && allowInGroup)
{
currItem->asGroupFrame()->adjustXYPosition();
- PageItem* ret = itemInGroup(currItem, itemPos, mouseArea);
+ PageItem* ret = itemInGroup(currItem, mouseArea);
if (ret != NULL)
return ret;
}
@@ -498,7 +498,7 @@
if (currItem->isGroup() && allowInGroup)
{
currItem->asGroupFrame()->adjustXYPosition();
- PageItem* ret = itemInGroup(currItem, itemPos, mouseArea);
+ PageItem* ret = itemInGroup(currItem, mouseArea);
if (ret != NULL)
{
if ((m_doc->drawAsPreview && !m_doc->editOnPreview) && !ret->isAnnotation())
@@ -535,31 +535,27 @@
return tg.contains(QPointF(mp.x(), mp.y()));
}
-PageItem* Canvas::itemInGroup(PageItem* group, QTransform itemPos, QRectF mouseArea) const
+PageItem* Canvas::itemInGroup(PageItem* group, QRectF mouseArea) const
{
int currNr = group->groupItemList.count() - 1;
while (currNr >= 0)
{
PageItem* embedded = group->groupItemList.at(currNr);
- QPainterPath currPath(itemPos.map(QPointF(0, 0)));
- currPath.lineTo(itemPos.map(QPointF(embedded->width(), 0)));
- currPath.lineTo(itemPos.map(QPointF(embedded->width(), embedded->height())));
- currPath.lineTo(itemPos.map(QPointF(0, embedded->height())));
+ QTransform itemPosN = embedded->getTransform();
+ QPainterPath currPath(itemPosN.map(QPointF(0, 0)));
+ currPath.lineTo(itemPosN.map(QPointF(embedded->width(), 0)));
+ currPath.lineTo(itemPosN.map(QPointF(embedded->width(), embedded->height())));
+ currPath.lineTo(itemPosN.map(QPointF(0, embedded->height())));
currPath.closeSubpath();
- currPath.translate(embedded->gXpos, embedded->gYpos);
QPainterPath currClip;
- currClip.addPolygon(itemPos.map(QPolygonF(embedded->Clip)));
+ currClip.addPolygon(itemPosN.map(QPolygonF(embedded->Clip)));
currClip.closeSubpath();
currClip.translate(embedded->gXpos, embedded->gYpos);
if (currPath.intersects(mouseArea) || currClip.intersects(mouseArea))
{
if (embedded->isGroup())
{
- QTransform itemPosG = itemPos;
- QTransform eTrans = embedded->getGroupTransform();
- itemPosG *= eTrans;
- itemPosG.scale(group->width() / group->groupWidth, group->height() / group->groupHeight);
- PageItem* ret = itemInGroup(embedded, itemPosG, mouseArea);
+ PageItem* ret = itemInGroup(embedded, mouseArea);
if (ret != NULL)
return ret;
}
Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18589&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Sun Nov 10 23:08:12 2013
@@ -180,7 +180,7 @@
(this flag is ignored in masterpage mode, since all items are masterpage items then).
*/
PageItem* itemUnderCursor(QPoint globalPos, PageItem* itemAbove=NULL, bool allowInGroup=false, bool allowMasterItems=false) const;
- PageItem* itemInGroup(PageItem* group, QTransform itemPos, QRectF mouseArea) const;
+ PageItem* itemInGroup(PageItem* group, QRectF mouseArea) const;
PageItem* itemUnderItem(PageItem* item, int& index) const;
const QPolygon& redrawPolygon() const { return m_viewMode.redrawPolygon; }
More information about the scribus-commit
mailing list