X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fsketcher%2Fsketcherwindow.C;h=f835d0072f3415026defdd0d8b870e4387b5c175;hp=7cbf15dd14b27b920bcde42b7da4a8c327d9ac34;hb=d72d54c0e9d75486bb003e256630c77f77ce6368;hpb=258d9cb69d560f40961acdd20866e12e940c2f93 diff --git a/cinelerra-5.1/plugins/sketcher/sketcherwindow.C b/cinelerra-5.1/plugins/sketcher/sketcherwindow.C index 7cbf15dd..f835d007 100644 --- a/cinelerra-5.1/plugins/sketcher/sketcherwindow.C +++ b/cinelerra-5.1/plugins/sketcher/sketcherwindow.C @@ -79,7 +79,7 @@ int SketcherCurvePenItem::handle_event() } SketcherCurvePen::SketcherCurvePen(SketcherWindow *gui, int x, int y, int pen) - : BC_PopupMenu(x,y,72,_(cv_pen[pen])) + : BC_PopupMenu(x,y,100,_(cv_pen[pen])) { this->gui = gui; this->pen = pen; @@ -122,7 +122,9 @@ void SketcherCurveColor::handle_done_event(int result) if( ci >= 0 && ci < config.curves.size() ) { SketcherCurve *cv = config.curves[ci]; cv->color = color; + gui->lock_window("SketcherCurveColor::handle_done_event"); gui->curve_list->update(ci); + gui->unlock_window(); gui->send_configure_change(); } } @@ -433,7 +435,7 @@ void SketcherWindow::create_objects() "Shift=\n" "None=\n" "Ctrl=\n" - "Alt=\n" + "Ctrl+Alt=\n" "Ctrl+Shift="))); dy = bmax(dy, notes0->get_h()); add_subwindow(notes1 = new BC_Title(x+100, y, _(" LMB\n" @@ -458,6 +460,8 @@ void SketcherWindow::create_objects() void SketcherWindow::done_event(int result) { + curve_color->close_picker(); + ungrab(plugin->server->mwindow->cwindow->gui); } void SketcherWindow::send_configure_change() @@ -505,15 +509,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; @@ -607,7 +612,7 @@ int SketcherWindow::grab_button_press(XEvent *event) point_list->update(pi); break; } - if( (state & AltMask) ) { // create new curve + if( (state & ControlMask) && (state & AltMask) ) { // create new curve ci = plugin->new_curve(cv->pen, cv->width, curve_color->color); curve_list->update(ci); point_list->update(-1); @@ -662,7 +667,7 @@ int SketcherWindow::grab_cursor_motion() return 1; } if( (state & Button1Mask) ) { - if( (state & ControlMask) ) { // drag selected point + if( (state & ControlMask) && !(state & AltMask) ) { // drag selected point SketcherPoint *pt = pi >= 0 && pi < points.size() ? points[pi] : 0; if( pt ) { point_list->set_point(pi, PT_X, pt->x = output_x); @@ -673,7 +678,7 @@ int SketcherWindow::grab_cursor_motion() } return 1; } - if( (state & AltMask) ) { // drag all curves + if( (state & ControlMask) && (state & AltMask) ) { // drag all curves int dx = round(output_x - last_x); int dy = round(output_y - last_y); for( int i=0; icurve_color->close_picker(); handle_event(); return 1; } @@ -970,7 +976,7 @@ int SketcherPointTypeItem::handle_event() } SketcherPointType::SketcherPointType(SketcherWindow *gui, int x, int y, int arc) - : BC_PopupMenu(x,y,64,_(pt_type[arc])) + : BC_PopupMenu(x,y,100,_(pt_type[arc])) { this->gui = gui; this->type = arc;