rubberband.cpp revision 080a261ed16d96daf01a6140ca7e66d6dc389ebd
/*
* Rubberbanding selector.
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 1999-2002 Lauris Kaplinski
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "display/sodipodi-ctrlrect.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "rubberband.h"
#include "display/sp-canvas.h"
#include "display/sp-canvas-item.h"
#include "display/canvas-bpath.h"
{
_touchpath_curve = new SPCurve();
}
{
if (_rect) {
}
if (_touchpath) {
_touchpath = NULL;
}
}
{
_desktop = d;
_start = p;
_started = true;
_touchpath_curve->moveto(p);
}
{
_started = false;
if (_desktop) {
}
}
{
if (!_started)
return;
_end = p;
_desktop->scroll_to_point(p);
_touchpath_curve->lineto(p);
// we want the points to be at most 0.5 screen pixels apart,
// so that we don't lose anything small;
// if they are farther apart, we interpolate more points
for (int i = 1; i <= subdiv; i ++) {
}
} else {
}
if (_mode == RUBBERBAND_MODE_RECT) {
_rect = static_cast<CtrlRect *>(sp_canvas_item_new(sp_desktop_controls(_desktop), SP_TYPE_CTRLRECT, NULL));
}
if (_touchpath)
} else if (_mode == RUBBERBAND_MODE_TOUCHPATH) {
if (_touchpath == NULL) {
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(_touchpath), 0xff0000ff, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
}
if (_rect)
}
}
{
}
{
if (!_started) {
}
}
{
}
return _instance;
}
{
return _started;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :