Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Equbuxu committed Dec 6, 2021
1 parent c5f145e commit 1e7f911
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions PixiEditor/Models/ImageManipulation/BitmapUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public static Surface CombineLayers(Int32Rect portion, IEnumerable<Layer> layers
for (int i = 0; i < layers.Count(); i++)
{
Layer layer = layers.ElementAt(i);
if (structure != null && !LayerStructureUtils.GetFinalLayerIsVisible(layer, structure))
continue;
float layerOpacity = structure == null ? layer.Opacity : LayerStructureUtils.GetFinalLayerOpacity(layer, structure);
paint.Color = new(255, 255, 255, (byte)(layerOpacity * 255));

Expand Down
6 changes: 2 additions & 4 deletions PixiEditor/Models/Tools/Tools/FloodFillTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@ public FloodFillTool(BitmapManager bitmapManager)

public override void Use(Layer layer, List<Coordinates> coordinates, SKColor color)
{
Stopwatch sw = new Stopwatch();
sw.Start();
if (layer.IsReset)
{
layer.DynamicResizeAbsolute(BitmapManager.ActiveDocument.Width, BitmapManager.ActiveDocument.Height, 0, 0);
layer.LayerBitmap.SkiaSurface.Canvas.Clear(color);
layer.InvokeLayerBitmapChange();
}
else
{
LinearFill(layer, coordinates[0], color);
}
sw.Stop();
Trace.WriteLine(sw.ElapsedMilliseconds);
}

public void LinearFill(Layer layer, Coordinates startingCoords, SKColor newColor)
Expand Down

0 comments on commit 1e7f911

Please sign in to comment.