index 367917915a6565a40e59d73e6270115edb1fb21b..3e04883b7853a9a335007261d9afc69e05d42626 100644 (file)
static gint
static gint
-sp_connector_context_item_handler(SPEventContext *ec, SPItem *item, GdkEvent *event)
+sp_connector_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event)
{
gint ret = FALSE;
{
gint ret = FALSE;
- SPDesktop *desktop = ec->desktop;
+ SPDesktop *desktop = event_context->desktop;
- SPConnectorContext *cc = SP_CONNECTOR_CONTEXT(ec);
+ SPConnectorContext *cc = SP_CONNECTOR_CONTEXT(event_context);
NR::Point p(event->button.x, event->button.y);
switch (event->type) {
case GDK_BUTTON_RELEASE:
NR::Point p(event->button.x, event->button.y);
switch (event->type) {
case GDK_BUTTON_RELEASE:
- if (event->button.button == 1) {
+ if (event->button.button == 1 && !event_context->space_panning) {
if ((cc->state == SP_CONNECTOR_CONTEXT_DRAGGING) &&
(connector_within_tolerance))
{
if ((cc->state == SP_CONNECTOR_CONTEXT_DRAGGING) &&
(connector_within_tolerance))
{
@@ -489,9 +489,10 @@ connector_handle_button_press(SPConnectorContext *const cc, GdkEventButton const
NR::Point const event_w(bevent.x, bevent.y);
/* Find desktop coordinates */
NR::Point p = cc->desktop->w2d(event_w);
NR::Point const event_w(bevent.x, bevent.y);
/* Find desktop coordinates */
NR::Point p = cc->desktop->w2d(event_w);
+ SPEventContext *event_context = SP_EVENT_CONTEXT(cc);
gint ret = FALSE;
gint ret = FALSE;
- if ( bevent.button == 1 ) {
+ if ( bevent.button == 1 && !event_context->space_panning ) {
SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc);
SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc);
@@ -528,7 +529,7 @@ connector_handle_button_press(SPConnectorContext *const cc, GdkEventButton const
// This is the first point, so just snap it to the grid
// as there's no other points to go off.
SnapManager const &m = cc->desktop->namedview->snap_manager;
// This is the first point, so just snap it to the grid
// as there's no other points to go off.
SnapManager const &m = cc->desktop->namedview->snap_manager;
- p = m.freeSnap(Inkscape::Snapper::SNAP_POINT | Inkscape::Snapper::BBOX_POINT,
+ p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE,
p, NULL).getPoint();
}
spcc_connector_set_initial_point(cc, p);
p, NULL).getPoint();
}
spcc_connector_set_initial_point(cc, p);
connector_handle_motion_notify(SPConnectorContext *const cc, GdkEventMotion const &mevent)
{
gint ret = FALSE;
connector_handle_motion_notify(SPConnectorContext *const cc, GdkEventMotion const &mevent)
{
gint ret = FALSE;
+ SPEventContext *event_context = SP_EVENT_CONTEXT(cc);
- if (mevent.state & GDK_BUTTON2_MASK || mevent.state & GDK_BUTTON3_MASK) {
+ if (event_context->space_panning || mevent.state & GDK_BUTTON2_MASK || mevent.state & GDK_BUTTON3_MASK) {
// allow middle-button scrolling
return FALSE;
}
// allow middle-button scrolling
return FALSE;
}
connector_handle_button_release(SPConnectorContext *const cc, GdkEventButton const &revent)
{
gint ret = FALSE;
connector_handle_button_release(SPConnectorContext *const cc, GdkEventButton const &revent)
{
gint ret = FALSE;
- if ( revent.button == 1 ) {
+ SPEventContext *event_context = SP_EVENT_CONTEXT(cc);
+ if ( revent.button == 1 && !event_context->space_panning ) {
SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc);
SPDocument *doc = sp_desktop_document(desktop);
SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc);
SPDocument *doc = sp_desktop_document(desktop);
static void
static void
-spcc_connector_finish_segment(SPConnectorContext *const cc, NR::Point const p)
+spcc_connector_finish_segment(SPConnectorContext *const cc, NR::Point const /*p*/)
{
if (!sp_curve_empty(cc->red_curve)) {
sp_curve_append_continuous(cc->green_curve, cc->red_curve, 0.0625);
{
if (!sp_curve_empty(cc->red_curve)) {
sp_curve_append_continuous(cc->green_curve, cc->red_curve, 0.0625);
static gboolean
static gboolean
-endpt_handler(SPKnot *knot, GdkEvent *event, SPConnectorContext *cc)
+endpt_handler(SPKnot */*knot*/, GdkEvent *event, SPConnectorContext *cc)
{
g_assert( SP_IS_CONNECTOR_CONTEXT(cc) );
{
g_assert( SP_IS_CONNECTOR_CONTEXT(cc) );
}
}
- NR::Rect bbox = sp_item_bbox_desktop(cc->active_shape);
- NR::Point center = bbox.midpoint();
- sp_knot_set_position(cc->connpthandle, ¢er, 0);
-
- sp_knot_show(cc->connpthandle);
-
+ NR::Maybe<NR::Rect> bbox = sp_item_bbox_desktop(cc->active_shape);
+ if (bbox) {
+ NR::Point center = bbox->midpoint();
+ sp_knot_set_position(cc->connpthandle, ¢er, 0);
+ sp_knot_show(cc->connpthandle);
+ } else {
+ sp_knot_hide(cc->connpthandle);
+ }
}
}
static void
static void
-shape_event_attr_deleted(Inkscape::XML::Node *repr, Inkscape::XML::Node *child,
- Inkscape::XML::Node *ref, gpointer data)
+shape_event_attr_deleted(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child,
+ Inkscape::XML::Node */*ref*/, gpointer data)
{
g_assert(data);
SPConnectorContext *cc = SP_CONNECTOR_CONTEXT(data);
{
g_assert(data);
SPConnectorContext *cc = SP_CONNECTOR_CONTEXT(data);
@@ -1358,8 +1363,8 @@ shape_event_attr_deleted(Inkscape::XML::Node *repr, Inkscape::XML::Node *child,
static void
shape_event_attr_changed(Inkscape::XML::Node *repr, gchar const *name,
static void
shape_event_attr_changed(Inkscape::XML::Node *repr, gchar const *name,
- gchar const *old_value, gchar const *new_value,
- bool is_interactive, gpointer data)
+ gchar const */*old_value*/, gchar const */*new_value*/,
+ bool /*is_interactive*/, gpointer data)
{
g_assert(data);
SPConnectorContext *cc = SP_CONNECTOR_CONTEXT(data);
{
g_assert(data);
SPConnectorContext *cc = SP_CONNECTOR_CONTEXT(data);