index 74f207809402a29322a22ddef5b09adecc501f1a..23bf70be5eb597e34a8cd58d67f61d4e71b5568e 100644 (file)
if ( (pv.size() == 1) && (pv.front().size() <= 1) ) {
// vector has only one path with only one segment, see if that's a non-curve segment: that would mean no internal region
- Geom::Curve const & c = pv.front().front();
- if ( typeid(c) == typeid(Geom::LineSegment) )
- return false;
- if ( typeid(c) == typeid(Geom::HLineSegment) )
- return false;
- if ( typeid(c) == typeid(Geom::VLineSegment) )
+ Geom::Curve const * c = & pv.front().front();
+ if ( dynamic_cast<Geom::LineSegment const*>(c) ||
+ dynamic_cast<Geom::HLineSegment const*>(c) ||
+ dynamic_cast<Geom::VLineSegment const*>(c) )
+ {
return false;
+ }
}
return true; //too costly to see if it has region to be filled, so return true.
@@ -1068,14 +1068,16 @@ nr_arena_shape_pick(NRArenaItem *item, NR::Point p, double delta, unsigned int /
if (!shape->curve) return NULL;
if (!shape->style) return NULL;
- if (SP_SCALE24_TO_FLOAT(shape->style->opacity.value) == 0) // fully transparent, no pick
+
+ bool outline = (NR_ARENA_ITEM(shape)->arena->rendermode == Inkscape::RENDERMODE_OUTLINE);
+
+ if (SP_SCALE24_TO_FLOAT(shape->style->opacity.value) == 0 && !outline)
+ // fully transparent, no pick unless outline mode
return NULL;
GTimeVal tstart, tfinish;
g_get_current_time (&tstart);
- bool outline = (NR_ARENA_ITEM(shape)->arena->rendermode == Inkscape::RENDERMODE_OUTLINE);
-
double width;
if (outline) {
width = 0.5;
@@ -1092,11 +1094,11 @@ nr_arena_shape_pick(NRArenaItem *item, NR::Point p, double delta, unsigned int /
&& shape->_fill.opacity > 1e-3 && !outline);
if (item->arena->canvasarena) {
- NR::Rect viewbox = item->arena->canvasarena->item.canvas->getViewbox();
- viewbox.growBy (width);
- pathv_matrix_point_bbox_wind_distance(shape->curve->get_pathvector(), shape->ctm, p, NULL, needfill? &wind : NULL, &dist, 0.5, &viewbox);
+ Geom::Rect viewbox = to_2geom(item->arena->canvasarena->item.canvas->getViewbox());
+ viewbox.expandBy (width);
+ pathv_matrix_point_bbox_wind_distance(shape->curve->get_pathvector(), to_2geom(shape->ctm), to_2geom(p), NULL, needfill? &wind : NULL, &dist, 0.5, &viewbox);
} else {
- pathv_matrix_point_bbox_wind_distance(shape->curve->get_pathvector(), shape->ctm, p, NULL, needfill? &wind : NULL, &dist, 0.5, NULL);
+ pathv_matrix_point_bbox_wind_distance(shape->curve->get_pathvector(), to_2geom(shape->ctm), to_2geom(p), NULL, needfill? &wind : NULL, &dist, 0.5, NULL);
}
g_get_current_time (&tfinish);