当前位置: 首页>>代码示例>>C++>>正文


C++ SPDesktop::current_zoom方法代码示例

本文整理汇总了C++中SPDesktop::current_zoom方法的典型用法代码示例。如果您正苦于以下问题:C++ SPDesktop::current_zoom方法的具体用法?C++ SPDesktop::current_zoom怎么用?C++ SPDesktop::current_zoom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SPDesktop的用法示例。


在下文中一共展示了SPDesktop::current_zoom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

static void
sp_gradient_context_add_stop_near_point (SPGradientContext *rc, SPItem *item,  Geom::Point mouse_p, guint32 /*etime*/)
{
    // item is the selected item. mouse_p the location in doc coordinates of where to add the stop

    SPEventContext *ec = SP_EVENT_CONTEXT(rc);
    SPDesktop *desktop = SP_EVENT_CONTEXT (rc)->desktop;

    double tolerance = (double) ec->tolerance;

    ec->get_drag()->addStopNearPoint (item, mouse_p, tolerance/desktop->current_zoom());

    sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
                      _("Add gradient stop"));

    ec->get_drag()->updateDraggers();
}
开发者ID:step21,项目名称:inkscape-osx-packaging-native,代码行数:17,代码来源:gradient-context.cpp

示例2: sp_mesh_context_split_near_point

/**
Split row/column near the mouse point.
*/
static void sp_mesh_context_split_near_point(SPMeshContext *rc, SPItem *item,  Geom::Point mouse_p, guint32 /*etime*/)
{

#ifdef DEBUG_MESH
    std::cout << "sp_mesh_context_split_near_point: entrance: " << mouse_p << std::endl;
#endif

    // item is the selected item. mouse_p the location in doc coordinates of where to add the stop

    SPEventContext *ec = SP_EVENT_CONTEXT(rc);
    SPDesktop *desktop = SP_EVENT_CONTEXT (rc)->desktop;

    double tolerance = (double) ec->tolerance;

    ec->get_drag()->addStopNearPoint (item, mouse_p, tolerance/desktop->current_zoom());

    DocumentUndo::done(sp_desktop_document (desktop), SP_VERB_CONTEXT_MESH,
                       _("Split mesh row/column"));

    ec->get_drag()->updateDraggers();
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:24,代码来源:mesh-context.cpp

示例3: b

/**
Returns true if mouse cursor over mesh edge.
*/
static bool
sp_mesh_context_is_over_line (SPMeshContext *rc, SPItem *item, Geom::Point event_p)
{
    SPDesktop *desktop = SP_EVENT_CONTEXT (rc)->desktop;

    //Translate mouse point into proper coord system
    rc->mousepoint_doc = desktop->w2d(event_p);

    SPCtrlCurve *curve = SP_CTRLCURVE(item);
    Geom::BezierCurveN<3> b( curve->p0, curve->p1, curve->p2, curve->p3 );
    Geom::Coord coord = b.nearestPoint( rc->mousepoint_doc ); // Coord == double
    Geom::Point nearest = b( coord );

    double dist_screen = Geom::L2 (rc->mousepoint_doc - nearest) * desktop->current_zoom();

    double tolerance = (double) SP_EVENT_CONTEXT(rc)->tolerance;

    bool close = (dist_screen < tolerance);

    return close;
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:24,代码来源:mesh-context.cpp


注:本文中的SPDesktop::current_zoom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。