Example #1
0
        private bool IsInVideoField(double offsetX, double offsetY)
        {
            var v                = ViewTimeline;
            var s                = CurrentSubtitleWraper;
            var posWrap          = CurrentSubtitleWraper.TranslatePoint(new Point(0, 0), Clips);
            var posClip          = ViewTimeline.TranslatePoint(new Point(0, 0), Clips);
            var VideoBoundingBox = new System.Drawing.Rectangle((int)posClip.X, (int)posClip.Y, (int)v.ActualWidth, (int)v.ActualHeight);
            var SubBox           = new System.Drawing.Rectangle((int)(posWrap.X + offsetX), (int)(posWrap.Y + offsetY), (int)s.ActualWidth, (int)s.ActualHeight);

            return(VideoBoundingBox.Contains(SubBox));
        }
Example #2
0
        private void Subtitle_MouseUp(object sender, MouseButtonEventArgs e)
        {
            Model.WindowState.DragInProgress = false;
            var shift = CurrentSubtitle.FontSize;

            Model.WindowState.currentSubtitle.X = Canvas.GetLeft(CurrentSubtitleWraper);
            Model.WindowState.currentSubtitle.Y = Canvas.GetTop(CurrentSubtitleWraper);
            var pos = CurrentSubtitleWraper.TranslatePoint(new Point(0, 0), ViewTimeline);

            Model.WindowState.currentSubtitle.Pos         = pos;
            Model.WindowState.currentSubtitle.HeightShift = shift;
        }