Beispiel #1
0
 private void OnMouseWheel(WheelEventArgs e)
 {
     NavigationSettings.OnMouseWheel(e);
     Nodes.ReRenderIfOffCanvasChanged();
     Links.TriggerStateHasChanged();
     Overview?.TriggerUpdate(just_pan_or_zoom: true);
 }
Beispiel #2
0
 internal void MoveOrigin(double offset_x, double offset_y)
 {
     NavigationSettings.Pan(offset_x, offset_y);
     Nodes.render_not_necessary = true;
     Nodes.ReRenderIfOffCanvasChanged();
     Links.render_not_necessary = true;
     render_necessary           = true;
     StateHasChanged();
 }
Beispiel #3
0
        private async Task GetPositionAsync()
        {
            (CanvasLeft, CanvasTop) = await js.GetPositionAsync(canvas);

            (CanvasWidth, CanvasHeight) = await js.GetDimensionsAsync(canvas);

            Nodes.ReRenderIfOffCanvasChanged();
            js_interop_reference_to_this ??= DotNetObjectReference.Create(this);
            await js.RegisterResizeObserverAsync(canvas, js_interop_reference_to_this);

            await js.RegisterMoveObserverAsync(canvas, js_interop_reference_to_this);
        }
Beispiel #4
0
 public void OnMove(Rect rect)
 {
     (CanvasLeft, CanvasTop, CanvasWidth, CanvasHeight) = (rect.Left, rect.Top, rect.Width, rect.Height);
     Nodes.ReRenderIfOffCanvasChanged();
     UpdateOverview();
 }
Beispiel #5
0
 public void ZoomToFit()
 {
     NavigationSettings.ZoomToFit();
     Nodes.ReRenderIfOffCanvasChanged();
     UpdateOverview(just_pan_or_zoom: true);
 }