src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs
changeset 166 33c2e634df13
parent 162 0b9f989bcb37
child 167 206f07a8d887
--- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs	Sun Oct 18 17:42:21 2009 +0200
+++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs	Wed Oct 21 16:28:49 2009 +0200
@@ -40,7 +40,7 @@
         private double totalmilliseconds;
         
         private List<Annotation> AnnotList = new List<Annotation>();
-        private float AnnotWidth = 300 + 15; // The surfaceListBox adds 15 pixels between each item
+        private float AnnotWidth = 850 + 15; // The surfaceListBox adds 15 pixels between each item
         private CuttingViewModel CuttingVM;
         private Boolean AnnotWaiting = false;
         private float AnnotTcBegin;
@@ -132,7 +132,7 @@
             // When scaleX = 1, 1 second = 1 pixel. To calculate the new scale, we take the real width in account.
             Double futurScale = (this.ActualWidth-30) / (totalmilliseconds / 1000);
             //Double futurScale = this.ActualWidth / ((totalmilliseconds<30000) ? (totalmilliseconds/10) : (totalmilliseconds / 1000)); // TEMP FOR SHORT CONTENTS
-            tv.RenderTransform = new ScaleTransform(futurScale,1);
+            tv.listview.RenderTransform = new ScaleTransform(futurScale,1);
             //tv.Width = this.ActualWidth - 30;
             
         }
@@ -379,8 +379,11 @@
             };
 
             // We apply the current scale to the dragged annotation
-            ((TimelineAnnotationView)cursorVisual.Content).RenderTransform = this.RenderTransform;
-
+            ((TimelineAnnotationView)cursorVisual.Content).RenderTransform = new TransformGroup();
+            ((TransformGroup)((TimelineAnnotationView)cursorVisual.Content).RenderTransform).Children.Add(tv.listview.RenderTransform);
+            // We apply a translate translate transform to place correctly the dragged annotation
+            ((TransformGroup)((TimelineAnnotationView)cursorVisual.Content).RenderTransform).Children.Add(new TranslateTransform((AnnotWidth / 2) * (1 - ((ScaleTransform)tv.listview.RenderTransform).ScaleX), 0));
+            
             // Add a handler. This will enable the application to change the visual cues. (NOT USEFUL IN FINGERSDANCE CASE)
             //SurfaceDragDrop.AddTargetChangedHandler(cursorVisual, OnTargetChanged);