add coordinate space comment
This commit is contained in:
parent
f25ff95390
commit
1eb680f937
@ -49,18 +49,19 @@ DumbLookupTable::get (Rect const &)
|
|||||||
return vitems;
|
return vitems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: what coordinate system is the point in? parent of our group I think */
|
|
||||||
vector<Item *>
|
vector<Item *>
|
||||||
DumbLookupTable::items_at_point (Duple point) const
|
DumbLookupTable::items_at_point (Duple point) const
|
||||||
{
|
{
|
||||||
|
/* Point is in canvas coordinate system */
|
||||||
|
|
||||||
list<Item *> items = _group.items ();
|
list<Item *> items = _group.items ();
|
||||||
vector<Item *> vitems;
|
vector<Item *> vitems;
|
||||||
|
|
||||||
for (list<Item *>::const_iterator i = items.begin(); i != items.end(); ++i) {
|
for (list<Item *>::const_iterator i = items.begin(); i != items.end(); ++i) {
|
||||||
boost::optional<Rect> item_bbox = (*i)->bounding_box ();
|
boost::optional<Rect> item_bbox = (*i)->bounding_box ();
|
||||||
if (item_bbox) {
|
if (item_bbox) {
|
||||||
Rect parent_bbox = (*i)->item_to_parent (item_bbox.get ());
|
Rect canvas_bbox = (*i)->item_to_canvas (item_bbox.get ());
|
||||||
if (parent_bbox.contains (point)) {
|
if (canvas_bbox.contains (point)) {
|
||||||
vitems.push_back (*i);
|
vitems.push_back (*i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user