Skip to content

Commit

Permalink
add external refresh method, improve image manipulation implementatio…
Browse files Browse the repository at this point in the history
…n (with nullable types) and remove unnessesary console output
  • Loading branch information
florian03-1 committed Feb 19, 2023
1 parent 0fdd38a commit 1b251e2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion BlazorSvgEditor.SvgEditor/SvgEditor.Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public int SelectedShapeId

//Image Manipulations
[Parameter] public bool EnableImageManipulations { get; set; } = true; //Use Image Manipulations (Brightness, Contrast, Saturation, Hue)
[Parameter] public ImageManipulations ImageManipulations { get; set; } = new(); //Image Manipulations (Brightness, Contrast, Saturation, Hue)
[Parameter] public ImageManipulations? ImageManipulations { get; set; } = new(); //Image Manipulations (Brightness, Contrast, Saturation, Hue)


public EditMode EditMode { get; set; } = EditMode.None; //Current edit mode
Expand Down Expand Up @@ -205,4 +205,5 @@ public async Task ReloadImage()
StateHasChanged();
}

public void Refresh() => StateHasChanged();
}
2 changes: 0 additions & 2 deletions BlazorSvgEditor.SvgEditor/SvgEditor.PointerEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ private async Task OnContainerPointerDown(PointerEventArgs e)
await AddToolPointerDown(e);
}
}

Console.WriteLine("OnContainerPointerDown");
}

private void OnContainerPointerUp(PointerEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion BlazorSvgEditor.SvgEditor/SvgEditor.razor
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{
<style>
.svg-img-filter{
filter: brightness(@(ImageManipulations.Brightness)%) contrast(@(ImageManipulations.Contrast)%) saturate(@(ImageManipulations.Saturation)%) hue-rotate(@(ImageManipulations.Hue)deg)
filter: brightness(@(ImageManipulations?.Brightness)%) contrast(@(ImageManipulations?.Contrast)%) saturate(@(ImageManipulations?.Saturation)%) hue-rotate(@(ImageManipulations?.Hue)deg)
}
</style>
}
Expand Down

0 comments on commit 1b251e2

Please sign in to comment.