|
Last change
on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
960 bytes
|
| Line | |
|---|
| 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.setBrushSettings = exports.brushSlice = exports.brushReducer = void 0;
|
|---|
| 7 | var _toolkit = require("@reduxjs/toolkit");
|
|---|
| 8 | /**
|
|---|
| 9 | * From all Brush properties, only height has a default value and will always be defined.
|
|---|
| 10 | * Other properties are nullable and will be computed from offsets and margins if they are not set.
|
|---|
| 11 | */
|
|---|
| 12 |
|
|---|
| 13 | var initialState = {
|
|---|
| 14 | x: 0,
|
|---|
| 15 | y: 0,
|
|---|
| 16 | width: 0,
|
|---|
| 17 | height: 0,
|
|---|
| 18 | padding: {
|
|---|
| 19 | top: 0,
|
|---|
| 20 | right: 0,
|
|---|
| 21 | bottom: 0,
|
|---|
| 22 | left: 0
|
|---|
| 23 | }
|
|---|
| 24 | };
|
|---|
| 25 | var brushSlice = exports.brushSlice = (0, _toolkit.createSlice)({
|
|---|
| 26 | name: 'brush',
|
|---|
| 27 | initialState,
|
|---|
| 28 | reducers: {
|
|---|
| 29 | setBrushSettings(_state, action) {
|
|---|
| 30 | if (action.payload == null) {
|
|---|
| 31 | return initialState;
|
|---|
| 32 | }
|
|---|
| 33 | return action.payload;
|
|---|
| 34 | }
|
|---|
| 35 | }
|
|---|
| 36 | });
|
|---|
| 37 | var {
|
|---|
| 38 | setBrushSettings
|
|---|
| 39 | } = brushSlice.actions;
|
|---|
| 40 | exports.setBrushSettings = setBrushSettings;
|
|---|
| 41 | var brushReducer = exports.brushReducer = brushSlice.reducer; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.