~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/zoom-context.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Kees Cook, Ted Gould
  • Date: 2008-02-10 14:20:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080210142016-vcnb2zqyhszu0xvb
Tags: 0.46~pre1-0ubuntu1
[ Kees Cook ]
* debian/control:
  - add libgtkspell-dev build-dep to gain GtkSpell features (LP: #183547).
  - update Standards version (no changes needed).
  - add Vcs and Homepage fields.
  - switch to new python-lxml dep.
* debian/{control,rules}: switch from dpatch to quilt for more sanity.
* debian/patches/20_fix_glib_and_gxx43_ftbfs.patch:
  - merged against upstream fixes.
  - added additional fixes for newly written code.
* debian/rules: enable parallel building.

[ Ted Gould ]
* Updating POTFILES.in to make it so things build correctly.
* debian/control:
  - add ImageMagick++ and libboost-dev to build-deps

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
 
125
125
    switch (event->type) {
126
126
        case GDK_BUTTON_PRESS:
127
 
            if (event->button.button == 1) {
 
127
        {
 
128
            NR::Point const button_w(event->button.x, event->button.y);
 
129
            NR::Point const button_dt(desktop->w2d(button_w));
 
130
            if (event->button.button == 1 && !event_context->space_panning) {
128
131
                // save drag origin
129
132
                xp = (gint) event->button.x;
130
133
                yp = (gint) event->button.y;
131
134
                within_tolerance = true;
132
135
 
133
 
                NR::Point const button_w(event->button.x, event->button.y);
134
 
                NR::Point const button_dt(desktop->w2d(button_w));
135
136
                Inkscape::Rubberband::get()->start(desktop, button_dt);
136
137
 
137
138
                escaped = false;
138
139
 
139
140
                ret = TRUE;
 
141
            } else if (event->button.button == 3) {
 
142
                double const zoom_rel( (event->button.state & GDK_SHIFT_MASK)
 
143
                                       ? zoom_inc
 
144
                                       : 1 / zoom_inc );
 
145
                desktop->zoom_relative_keep_point(button_dt, zoom_rel);
 
146
                ret = TRUE;
140
147
            }
141
148
            break;
 
149
        }
142
150
 
143
151
        case GDK_MOTION_NOTIFY:
144
 
            if (event->motion.state & GDK_BUTTON1_MASK) {
 
152
            if (event->motion.state & GDK_BUTTON1_MASK && !event_context->space_panning) {
145
153
                ret = TRUE;
146
154
 
147
155
                if ( within_tolerance
157
165
                NR::Point const motion_w(event->motion.x, event->motion.y);
158
166
                NR::Point const motion_dt(desktop->w2d(motion_w));
159
167
                Inkscape::Rubberband::get()->move(motion_dt);
 
168
                gobble_motion_events(GDK_BUTTON1_MASK);
160
169
            }
161
170
            break;
162
171
 
163
 
        case GDK_BUTTON_RELEASE:
164
 
            if ( event->button.button == 1 ) {
 
172
        case GDK_BUTTON_RELEASE:
 
173
        {
 
174
            NR::Point const button_w(event->button.x, event->button.y);
 
175
            NR::Point const button_dt(desktop->w2d(button_w));
 
176
            if ( event->button.button == 1  && !event_context->space_panning) {
165
177
                NR::Maybe<NR::Rect> const b = Inkscape::Rubberband::get()->getRectangle();
166
 
                if (b != NR::Nothing() && !within_tolerance) {
167
 
                    desktop->set_display_area(b.assume(), 10);
 
178
                if (b && !within_tolerance) {
 
179
                    desktop->set_display_area(*b, 10);
168
180
                } else if (!escaped) {
169
 
                    NR::Point const button_w(event->button.x, event->button.y);
170
 
                    NR::Point const button_dt(desktop->w2d(button_w));
171
181
                    double const zoom_rel( (event->button.state & GDK_SHIFT_MASK)
172
182
                                           ? 1 / zoom_inc
173
183
                                           : zoom_inc );
174
184
                    desktop->zoom_relative_keep_point(button_dt, zoom_rel);
175
185
                }
176
186
                ret = TRUE;
177
 
            }
 
187
            } 
178
188
            Inkscape::Rubberband::get()->stop();
179
189
            xp = yp = 0;
180
190
            escaped = false;
181
191
            break;
182
 
 
 
192
        }
183
193
        case GDK_KEY_PRESS:
184
194
            switch (get_group0_keyval (&event->key)) {
185
195
                case GDK_Escape: