public override void Use(Layer activeLayer, Layer previewLayer, IEnumerable <Layer> allLayers, IReadOnlyList <Coordinates> recordedMouseMovement, SKColor color) { int toolSize = Toolbar.GetSetting <SizeSetting>("ToolSize").Value; float correctionFactor = Toolbar.GetSetting <FloatSetting>("CorrectionFactor").Value; Mode = Toolbar.GetEnumSetting <BrightnessMode>("BrightnessMode").Value; if (Session.IsCtrlDown) { ChangeBrightness(activeLayer, recordedMouseMovement[^ 1], toolSize, -correctionFactor);
public override LayerChange[] Use(Layer layer, List <Coordinates> coordinates, Color color) { int toolSize = Toolbar.GetSetting <SizeSetting>("ToolSize").Value; float correctionFactor = Toolbar.GetSetting <FloatSetting>("CorrectionFactor").Value; Mode = Toolbar.GetEnumSetting <BrightnessMode>("BrightnessMode").Value; LayerChange[] layersChanges = new LayerChange[1]; if (Keyboard.IsKeyDown(Key.LeftCtrl)) { layersChanges[0] = new LayerChange(ChangeBrightness(layer, coordinates[0], toolSize, -correctionFactor), layer); } else { layersChanges[0] = new LayerChange(ChangeBrightness(layer, coordinates[0], toolSize, correctionFactor), layer); } return(layersChanges); }
public override LayerChange[] Use(Layer layer, Coordinates[] coordinates, Color color) { int toolSize = Toolbar.GetSetting <SizeSetting>("ToolSize").Value; float correctionFactor = Toolbar.GetSetting <FloatSetting>("CorrectionFactor").Value; Enum.TryParse((Toolbar.GetSetting <DropdownSetting>("BrightnessMode")?.Value as ComboBoxItem)?.Content as string, out BrightnessMode mode); Mode = mode; LayerChange[] layersChanges = new LayerChange[1]; if (Keyboard.IsKeyDown(Key.LeftCtrl)) { layersChanges[0] = new LayerChange(ChangeBrightness(layer, coordinates[0], toolSize, -correctionFactor), layer); } else { layersChanges[0] = new LayerChange(ChangeBrightness(layer, coordinates[0], toolSize, correctionFactor), layer); } return(layersChanges); }