aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-07-30 23:41:33 +0200
committerThomas White <taw@bitwiz.org.uk>2013-07-30 23:41:33 +0200
commit00fc80a5ad67b3c7a84dd9a5d3785441a4379e1e (patch)
treeed1c6f580fd5f35d6af53637ee7f8b2e21ffd7f3 /src/mainwindow.c
parent87a3119229f4f09321a01f73b2827c2473e0e4ea (diff)
More selection/dragging logic
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r--src/mainwindow.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index a21e201..0e639ba 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -1139,37 +1139,35 @@ static gboolean button_press_sig(GtkWidget *da, GdkEventButton *event,
{
enum corner c;
gdouble x, y;
+ struct frame *clicked;
x = event->x - p->border_offs_x;
y = event->y - p->border_offs_y;
- if ( p->n_selection == 0 ) {
- struct frame *clicked;
+ clicked = find_frame_at_position(p->cur_edit_slide->top, x, y);
- clicked = find_frame_at_position(p->cur_edit_slide->top, x, y);
+ if ( clicked == NULL ) {
- if ( clicked == NULL ) {
+ /* Clicked no object. Deselect old object and set up for
+ * (maybe) creating a new one. */
- /* Clicked no object. Deselect old object and set up for
- * (maybe) creating a new one. */
+ set_selection(p, NULL);
+ p->start_corner_x = event->x - p->border_offs_x;
+ p->start_corner_y = event->y - p->border_offs_y;
+ p->drag_status = DRAG_STATUS_COULD_DRAG;
+ p->drag_reason = DRAG_REASON_CREATE;
- set_selection(p, NULL);
- p->start_corner_x = event->x - p->border_offs_x;
- p->start_corner_y = event->y - p->border_offs_y;
- p->drag_status = DRAG_STATUS_COULD_DRAG;
- p->drag_reason = DRAG_REASON_CREATE;
+ } else {
- } else {
+ /* Select new frame */
+ p->drag_status = DRAG_STATUS_NONE;
+ p->drag_reason = DRAG_REASON_NONE;
+ set_selection(p, clicked);
- /* Select new frame */
- p->drag_status = DRAG_STATUS_NONE;
- p->drag_reason = DRAG_REASON_NONE;
- set_selection(p, clicked);
-
- }
+ }
- } else {
+ if ( p->n_selection > 0 ) {
struct frame *fr;