Skip to content

Commit

Permalink
add cursors
Browse files Browse the repository at this point in the history
  • Loading branch information
Heathermcx committed Dec 7, 2023
1 parent 32b36b6 commit d15c24a
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 79 deletions.
2 changes: 2 additions & 0 deletions src/Blazor.Diagrams.Core/Controls/Default/ResizeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public ResizeControl(IResizerProvider resizeProvider)

public override Point? GetPosition(Model model) => _resizeProvider.GetPosition(model);

public string? Class => _resizeProvider.Class;

public override ValueTask OnPointerDown(Diagram diagram, Model model, PointerEventArgs e)
{
_resizeProvider.OnResizeStart(diagram, model, e);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ namespace Blazor.Diagrams.Core.Positions.Resizing
{
public class BottomLeftResizerProvider : IResizerProvider
{
private Size _originalSize = null!;
public string? Class => "bottomleft";

private Size _originalSize = null!;
private Point _originalPosition = null!;
private Point _originalMousePosition = null!;
private NodeModel _nodeModel = null!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ namespace Blazor.Diagrams.Core.Positions.Resizing
{
public class BottomRightResizerProvider : IResizerProvider
{
public string? Class => "bottomright";

private Size _originalSize = null!;
private Point _originalMousePosition = null!;
private NodeModel _nodeModel = null!;

public Point? GetPosition(Model model)
public Point? GetPosition(Model model)
{
if (model is NodeModel nodeModel && nodeModel.Size is not null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Blazor.Diagrams.Core.Positions.Resizing
{
public interface IResizerProvider : IPositionProvider
{
public string? Class { get; }
public void OnResizeStart(Diagram diagram, Model model, PointerEventArgs eventArgs);
public void OnPointerMove(Model? model, PointerEventArgs args);
public void OnResizeEnd(Model? model, PointerEventArgs args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ namespace Blazor.Diagrams.Core.Positions.Resizing
{
public class TopLeftResizerProvider : IResizerProvider
{
private Size _originalSize = null!;
public string? Class => "topleft";

private Size _originalSize = null!;
private Point _originalPosition = null!;
private Point _originalMousePosition = null!;
private NodeModel _nodeModel = null!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ namespace Blazor.Diagrams.Core.Positions.Resizing
{
public class TopRightResizerProvider : IResizerProvider
{
private Size _originalSize = null!;
public string? Class => "topright";

private Size _originalSize = null!;
private Point _originalPosition = null!;
private Point _originalMousePosition = null!;
private NodeModel _nodeModel = null!;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="default-node-resizer" />
<div class="default-node-resizer @Control.Class" />

@code
{
Expand Down
16 changes: 16 additions & 0 deletions src/Blazor.Diagrams/wwwroot/default.styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Blazor.Diagrams/wwwroot/default.styles.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified src/Blazor.Diagrams/wwwroot/default.styles.min.css.gz
Binary file not shown.

0 comments on commit d15c24a

Please sign in to comment.