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

List:       kde-commits
Subject:    KDE/kdegames/kolf/tagaro
From:       Stefan Majewsky <majewsky () gmx ! net>
Date:       2010-10-31 22:15:22
Message-ID: 20101031221522.02A14AC8AD () svn ! kde ! org
[Download RAW message or body]

SVN commit 1191678 by majewsky:

Import a fix from Tagaro which is necessary to make the editing work.

 M  +8 -1      spriteobjectitem.cpp  


--- trunk/KDE/kdegames/kolf/tagaro/spriteobjectitem.cpp #1191677:1191678
@@ -156,7 +156,14 @@
 
 bool Tagaro::SpriteObjectItem::contains(const QPointF& point) const
 {
-	return d->QGraphicsPixmapItem::contains(d->mapFromParent(point));
+	//return d->QGraphicsPixmapItem::contains(d->mapFromParent(point));
+	//This does not work because QGraphicsPixmapItem::contains is actually not
+	//implemented. (It is, but it just calls QGraphicsItem::contains as of 4.7.)
+	const QPixmap& pixmap = d->pixmap();
+	if (pixmap.isNull())
+		return false;
+	const QPoint pixmapPoint = d->mapFromParent(point).toPoint();
+	return pixmap.copy(QRect(pixmapPoint, QSize(1, 1))).toImage().pixel(0, 0);
 }
 
 bool Tagaro::SpriteObjectItem::isObscuredBy(const QGraphicsItem* item) const
[prev in list] [next in list] [prev in thread] [next in thread] 

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