diff --git a/src/application/constants.js b/src/application/constants.js index c397f5612..70bc9eb68 100644 --- a/src/application/constants.js +++ b/src/application/constants.js @@ -15,3 +15,7 @@ export default { return 512; } }; + +export const GROUP_DISABLED = 0; +export const GROUP_ENABLED = 1; +export const GROUP_DRAW_TO_OUTPUT = 2; diff --git a/src/application/index.js b/src/application/index.js index f76f85f15..02ac2b24b 100644 --- a/src/application/index.js +++ b/src/application/index.js @@ -15,6 +15,7 @@ import PromiseWorker from "promise-worker-transferable"; import Vue from "vue"; import { ipcRenderer } from "electron"; import { app } from "@electron/remote"; +import { GROUP_ENABLED } from "./constants"; let imageBitmap; const imageBitmapQueue = []; @@ -132,7 +133,7 @@ export default class ModV { }; // Make the default group - this.store.dispatch("groups/createGroup", { enabled: true }); + this.store.dispatch("groups/createGroup", { enabled: GROUP_ENABLED }); window.addEventListener("beforeunload", () => true); } diff --git a/src/application/worker/loop.js b/src/application/worker/loop.js index 2d8f7b07e..f6aa8d444 100644 --- a/src/application/worker/loop.js +++ b/src/application/worker/loop.js @@ -2,7 +2,7 @@ import get from "lodash.get"; import store from "./store"; import map from "../utils/map"; -import constants from "../constants"; +import constants, { GROUP_DISABLED, GROUP_ENABLED } from "../constants"; import { applyWindow } from "meyda/src/utilities"; const meyda = { windowing: applyWindow }; @@ -142,7 +142,7 @@ function loop(delta, features, fftOutput) { const isGalleryGroup = group.name === constants.GALLERY_GROUP_NAME; const groupModulesLength = group.modules.length; - if (!group.enabled || group.alpha < 0.001) { + if (group.enabled === GROUP_DISABLED || group.alpha < 0.001) { continue; } @@ -286,7 +286,7 @@ function loop(delta, features, fftOutput) { } } - if (!group.hidden) { + if (!group.hidden && group.enabled === GROUP_ENABLED) { lastCanvas = drawTo.canvas; } } @@ -307,7 +307,7 @@ function loop(delta, features, fftOutput) { modules } = group; const groupModulesLength = modules.length; - if (!enabled || groupModulesLength < 1 || !(alpha > 0)) { + if (enabled !== GROUP_ENABLED || groupModulesLength < 1 || !(alpha > 0)) { continue; } diff --git a/src/application/worker/store/modules/groups.js b/src/application/worker/store/modules/groups.js index 396c3ffe7..5238acbb0 100644 --- a/src/application/worker/store/modules/groups.js +++ b/src/application/worker/store/modules/groups.js @@ -1,6 +1,6 @@ import SWAP from "./common/swap"; import store from "../"; -import constants from "../../../constants"; +import constants, { GROUP_DISABLED } from "../../../constants"; import uuidv4 from "uuid/v4"; import { applyExpression } from "../../../utils/apply-expression"; @@ -15,7 +15,8 @@ import { applyExpression } from "../../../utils/apply-expression"; * * @property {Array} modules The draw order of the Modules contained within the Group * - * @property {Boolean} enabled Indicates whether the Group should be drawn + * @property {Number} enabled Indicates whether the Group should be drawn. 0: not drawn, + * 1: drawn, 2: not drawn to output canvas * * @property {Number} alpha The level of opacity, between 0 and 1, the Group should * be drawn at @@ -34,9 +35,6 @@ import { applyExpression } from "../../../utils/apply-expression"; * * @property {String} compositeOperation The {@link Blendmode} the Group muxes with * - * @property {Boolean} drawToOutput Indicates whether the Group should draw to the output - * canvas - * * @property {String} drawToCanvasId The ID of the auxillary Canvas to draw the Group to, * null indicates the Group should draw to the main output * @@ -133,7 +131,7 @@ const actions = { name, id, clearing: args.clearing || false, - enabled: args.enabled || false, + enabled: Number(args.enabled) || GROUP_DISABLED, hidden: args.hidden || false, modules: args.modules || [], inherit, diff --git a/src/components/GalleryItem.vue b/src/components/GalleryItem.vue index 40d67dcf0..a2ef17ca1 100644 --- a/src/components/GalleryItem.vue +++ b/src/components/GalleryItem.vue @@ -12,6 +12,8 @@ @@ -34,7 +79,7 @@ label.light { background: #363636; } -input:checked + span::before { +span.on::before { content: ""; width: 10px; height: 4px; @@ -47,16 +92,15 @@ input:checked + span::before { transform: translateX(2px) translateY(3px) rotate(-45deg); } -/* input:checked + span::after { +span.partial::before { content: ""; - width: 15px; - height: 15px; + width: 10px; + height: 4px; display: inline-block; position: absolute; - top: 2px; - right: 3px; - border-top: 2px solid white; - transform: rotate(-45deg); - transform-origin: right top; -} */ + top: 0; + left: 0; + border-bottom: 2px solid white; + transform: translateX(3px) translateY(3px); +}