mem leaks, fix canvas_h bug, diamond for bezier entpts, aging_plugin segv, grab bound...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / sketcher / sketcherwindow.C
index 4a0f18f9a439b5adc8294e478bfdbe0b78ae3943..77ed39ea6c4e94af38ce13dbd0151279614adee2 100644 (file)
@@ -460,6 +460,7 @@ void SketcherWindow::create_objects()
 
 void SketcherWindow::done_event(int result)
 {
+       ungrab(plugin->server->mwindow->cwindow->gui);
 }
 
 void SketcherWindow::send_configure_change()
@@ -507,15 +508,16 @@ int SketcherWindow::do_grab_event(XEvent *event)
        CWindowGUI *cwindow_gui = mwindow->cwindow->gui;
        CWindowCanvas *canvas = cwindow_gui->canvas;
        int cx, cy;  cwindow_gui->get_relative_cursor(cx, cy);
-       cx -= mwindow->theme->ccanvas_x;
-       cy -= mwindow->theme->ccanvas_y;
+       cx -= canvas->view_x;
+       cy -= canvas->view_y;
 
        if( !dragging ) {
-               if( cx < 0 || cx >= mwindow->theme->ccanvas_w ||
-                   cy < 0 || cy >= mwindow->theme->ccanvas_h )
+               if( cx < 0 || cx >= canvas->view_w ||
+                   cy < 0 || cy >= canvas->view_h )
                        return 0;
        }
 
+
        switch( event->type ) {
        case ButtonPress:
                if( dragging ) return 0;