protected override void DragInternal(ScoreRendererBase renderer, Lyrics draggedElement, DraggingState draggingState, double delta, double smallDelta)
 {
     draggedElement.SuppressEvents = true;
     if (!draggedElement.DefaultYPosition.HasValue)
     {
         draggedElement.DefaultYPosition = renderer.PixelsToTenths(-30);
     }
     draggedElement.DefaultYPosition += renderer.PixelsToTenths(smallDelta);
     draggedElement.SuppressEvents    = false;
     draggedElement.InvalidateMeasure();
 }
        protected override void DragInternal(ScoreRendererBase renderer, Note draggedElement, DraggingState draggingState, double delta, double smallDelta)
        {
            Contract.Assert(draggedElement != null);
            int midiPitch = draggingState.MidiPitchOnStartDragging + (int)(delta / 2);

            draggedElement.SuppressEvents = true;
            draggedElement.ApplyMidiPitch(midiPitch);                 //TODO: Wstawianie kasownika, jeśli jest znak przykluczowy, a obniżyliśmy o pół tonu
            //TODO: Ustalanie kierunku ogonka. Sprawdzić czy gdzieś to nie jest już zrobione, np. w PSAMie

            DetermineStemDirection(draggedElement);

            draggedElement.SuppressEvents = false;
            draggedElement.InvalidateMeasure();
        }
 protected override void DragInternal(ScoreRendererBase renderer, Direction draggedElement, DraggingState draggingState, double delta, double smallDelta)
 {
     draggedElement.SuppressEvents    = true;
     draggedElement.Placement         = DirectionPlacementType.Custom;
     draggedElement.SuppressEvents    = false;
     draggedElement.DefaultYPosition += renderer.PixelsToTenths(smallDelta);
 }
        protected override void DragInternal(ScoreRendererBase renderer, BeamGroup draggedElement, DraggingState draggingState, double delta, double smallDelta)
        {
            if (draggedElement.Members.OfType <Note>().Count() < 2)
            {
                return;
            }
            var firstElement = draggedElement.Members.OfType <Note>().First();
            var lastElement  = draggedElement.Members.OfType <Note>().Last();

            firstElement.SuppressEvents = true;
            lastElement.SuppressEvents  = true;

            if (!firstElement.HasCustomStemEndPosition)
            {
                firstElement.StemDefaultY             = renderer.PixelsToTenths(firstElement.StemEndLocation.Y - firstElement.TextBlockLocation.Y);
                firstElement.HasCustomStemEndPosition = true;
            }
            if (!lastElement.HasCustomStemEndPosition)
            {
                lastElement.StemDefaultY             = renderer.PixelsToTenths(lastElement.StemEndLocation.Y - firstElement.TextBlockLocation.Y);
                lastElement.HasCustomStemEndPosition = true;
            }

            firstElement.StemDefaultY -= smallDelta;
            lastElement.StemDefaultY  -= smallDelta;

            foreach (var element in draggedElement.Members.OfType <Note>())
            {
                element.SuppressEvents = true;
                NoteDraggingStrategy.DetermineStemDirection(element);
                element.SuppressEvents = false;
            }

            firstElement.SuppressEvents = false;
            lastElement.SuppressEvents  = false;
            draggedElement.InvalidateMeasure();
        }
Exemple #5
0
 protected override void DragInternal(ScoreRendererBase renderer, Rest draggedElement, DraggingState draggingState, double delta, double smallDelta)
 {
     if (!draggedElement.DefaultYPosition.HasValue)
     {
         draggedElement.SuppressEvents   = true;
         draggedElement.DefaultYPosition = 0;
         draggedElement.SuppressEvents   = false;
     }
     draggedElement.DefaultYPosition -= renderer.PixelsToTenths(smallDelta);
 }