[gimp/wip/animation: 356/373] plug-ins: dragging the display area only works for cel animations...
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/animation: 356/373] plug-ins: dragging the display area only works for cel animations...
- Date: Sat, 7 Oct 2017 02:24:39 +0000 (UTC)
commit 5fc57bea98bd9036e8808dfbd140be00ed964399
Author: Jehan <jehan girinstud io>
Date: Sat Jul 22 13:59:19 2017 +0200
plug-ins: dragging the display area only works for cel animations...
... for the time being.
plug-ins/animation-play/widgets/animation-dialog.c | 26 +++++++++++++-------
1 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/plug-ins/animation-play/widgets/animation-dialog.c
b/plug-ins/animation-play/widgets/animation-dialog.c
index c4a9452..51bd557 100755
--- a/plug-ins/animation-play/widgets/animation-dialog.c
+++ b/plug-ins/animation-play/widgets/animation-dialog.c
@@ -2391,7 +2391,8 @@ da_button_press (GtkWidget *widget,
event->time);
return TRUE;
}
- else if (event->type == GDK_BUTTON_PRESS)
+ else if (event->type == GDK_BUTTON_PRESS &&
+ ANIMATION_IS_CEL_ANIMATION (priv->animation))
{
CursorOffset *p = g_object_get_data (G_OBJECT (widget),
"cursor-offset");
@@ -2420,16 +2421,20 @@ da_button_released (GtkWidget *widget,
AnimationDialog *dialog)
{
AnimationDialogPrivate *priv = GET_PRIVATE (dialog);
- AnimationCelAnimation *animation;
- AnimationCamera *camera;
- animation = ANIMATION_CEL_ANIMATION (priv->animation);
- camera = ANIMATION_CAMERA (animation_cel_animation_get_main_camera (animation));
- animation_camera_apply_preview (camera);
+ if (ANIMATION_IS_CEL_ANIMATION (priv->animation))
+ {
+ AnimationCelAnimation *animation;
+ AnimationCamera *camera;
- gtk_grab_remove (widget);
- gdk_display_pointer_ungrab (gtk_widget_get_display (widget), 0);
- gdk_flush ();
+ animation = ANIMATION_CEL_ANIMATION (priv->animation);
+ camera = ANIMATION_CAMERA (animation_cel_animation_get_main_camera (animation));
+ animation_camera_apply_preview (camera);
+
+ gtk_grab_remove (widget);
+ gdk_display_pointer_ungrab (gtk_widget_get_display (widget), 0);
+ gdk_flush ();
+ }
return FALSE;
}
@@ -2441,6 +2446,9 @@ da_button_motion (GtkWidget *widget,
{
AnimationDialogPrivate *priv = GET_PRIVATE (dialog);
+ if (! ANIMATION_IS_CEL_ANIMATION (priv->animation))
+ return FALSE;
+
/* if a button is still held by the time we process this event... */
if (event->state & GDK_BUTTON1_MASK)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]