本文整理汇总了C++中SPDesktop::scroll_to_point方法的典型用法代码示例。如果您正苦于以下问题:C++ SPDesktop::scroll_to_point方法的具体用法?C++ SPDesktop::scroll_to_point怎么用?C++ SPDesktop::scroll_to_point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPDesktop
的用法示例。
在下文中一共展示了SPDesktop::scroll_to_point方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sp_selection_move_screen
//.........这里部分代码省略.........
item_at_point = desktop->item_at_point(Geom::Point(xp, yp), FALSE);
if (item_at_point || sc->moved || sc->button_press_alt) {
// drag only if starting from an item, or if something is already grabbed, or if alt-dragging
if (!sc->moved) {
item_in_group = desktop->item_at_point(Geom::Point(event->button.x, event->button.y), TRUE);
group_at_point = desktop->group_at_point(Geom::Point(event->button.x, event->button.y));
if (SP_IS_LAYER(selection->single()))
group_at_point = SP_GROUP(selection->single());
// group-at-point is meant to be topmost item if it's a group,
// not topmost group of all items at point
if (group_at_point != item_in_group &&
!(group_at_point && item_at_point &&
group_at_point->isAncestorOf(item_at_point)))
group_at_point = NULL;
// if neither a group nor an item (possibly in a group) at point are selected, set selection to the item at point
if ((!item_in_group || !selection->includes(item_in_group)) &&
(!group_at_point || !selection->includes(group_at_point))
&& !sc->button_press_alt) {
// select what is under cursor
if (!seltrans->isEmpty()) {
seltrans->resetState();
}
// when simply ctrl-dragging, we don't want to go into groups
if (item_at_point && !selection->includes(item_at_point))
selection->set(item_at_point);
} // otherwise, do not change selection so that dragging selected-within-group items, as well as alt-dragging, is possible
seltrans->grab(p, -1, -1, FALSE, TRUE);
sc->moved = TRUE;
}
if (!seltrans->isEmpty())
seltrans->moveTo(p, event->button.state);
desktop->scroll_to_point(p);
gobble_motion_events(GDK_BUTTON1_MASK);
ret = TRUE;
} else {
sc->dragging = FALSE;
sp_event_context_discard_delayed_snap_event(event_context);
desktop->canvas->end_forced_full_redraws();
}
} else {
if (Inkscape::Rubberband::get(desktop)->is_started()) {
Inkscape::Rubberband::get(desktop)->move(p);
if (Inkscape::Rubberband::get(desktop)->getMode() == RUBBERBAND_MODE_TOUCHPATH) {
event_context->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("<b>Draw over</b> objects to select them; release <b>Alt</b> to switch to rubberband selection"));
} else {
event_context->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("<b>Drag around</b> objects to select them; press <b>Alt</b> to switch to touch selection"));
}
gobble_motion_events(GDK_BUTTON1_MASK);
}
}
}
break;
case GDK_BUTTON_RELEASE:
xp = yp = 0;
if ((event->button.button == 1) && (sc->grabbed) && !event_context->space_panning) {
if (sc->dragging) {
if (sc->moved) {
// item has been moved
seltrans->ungrab();
sc->moved = FALSE;
} else if (sc->item && !drag_escaped) {
// item has not been moved -> simply a click, do selecting
if (!selection->isEmpty()) {
if (event->button.state & GDK_SHIFT_MASK) {