mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 04:37:22 -05:00
fix(Occlusion): remember toggle translucency setting (#4366)
* remember translucency Adding myself to contributors Added braces surrounding if statement to comply with ninja checks * ninja fix format
This commit is contained in:
parent
a842ba1498
commit
0986af4f81
3 changed files with 18 additions and 3 deletions
|
|
@ -246,6 +246,7 @@ Aldlss <ayaldlss@gmail.com>
|
||||||
Hanna Nilsén <hanni614@student.liu.se>
|
Hanna Nilsén <hanni614@student.liu.se>
|
||||||
Elias Johansson Lara <elias.johanssonlara@gmail.com>
|
Elias Johansson Lara <elias.johanssonlara@gmail.com>
|
||||||
Toby Penner <tobypenner01@gmail.com>
|
Toby Penner <tobypenner01@gmail.com>
|
||||||
|
Danilo Spillebeen <spillebeendanilo@gmail.com>
|
||||||
|
|
||||||
********************
|
********************
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
saveNeededStore,
|
saveNeededStore,
|
||||||
opacityStateStore,
|
opacityStateStore,
|
||||||
} from "./store";
|
} from "./store";
|
||||||
|
import { get } from "svelte/store";
|
||||||
import { drawEllipse, drawPolygon, drawRectangle, drawText } from "./tools/index";
|
import { drawEllipse, drawPolygon, drawRectangle, drawText } from "./tools/index";
|
||||||
import { makeMaskTransparent, SHAPE_MASK_COLOR } from "./tools/lib";
|
import { makeMaskTransparent, SHAPE_MASK_COLOR } from "./tools/lib";
|
||||||
import { enableSelectable, stopDraw } from "./tools/lib";
|
import { enableSelectable, stopDraw } from "./tools/lib";
|
||||||
|
|
@ -233,7 +234,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
opacityStateStore.set(maskOpacity);
|
maskOpacity = get(opacityStateStore);
|
||||||
removeHandlers = singleCallback(
|
removeHandlers = singleCallback(
|
||||||
on(document, "click", onClick),
|
on(document, "click", onClick),
|
||||||
on(window, "mousemove", onMousemove),
|
on(window, "mousemove", onMousemove),
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,22 @@ import { fabric } from "fabric";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
|
|
||||||
import { optimumCssSizeForCanvas } from "./canvas-scale";
|
import { optimumCssSizeForCanvas } from "./canvas-scale";
|
||||||
import { hideAllGuessOne, notesDataStore, saveNeededStore, tagsWritable, textEditingState } from "./store";
|
import {
|
||||||
|
hideAllGuessOne,
|
||||||
|
notesDataStore,
|
||||||
|
opacityStateStore,
|
||||||
|
saveNeededStore,
|
||||||
|
tagsWritable,
|
||||||
|
textEditingState,
|
||||||
|
} from "./store";
|
||||||
import Toast from "./Toast.svelte";
|
import Toast from "./Toast.svelte";
|
||||||
import { addShapesToCanvasFromCloze } from "./tools/add-from-cloze";
|
import { addShapesToCanvasFromCloze } from "./tools/add-from-cloze";
|
||||||
import { enableSelectable, makeShapesRemainInCanvas, moveShapeToCanvasBoundaries } from "./tools/lib";
|
import {
|
||||||
|
enableSelectable,
|
||||||
|
makeMaskTransparent,
|
||||||
|
makeShapesRemainInCanvas,
|
||||||
|
moveShapeToCanvasBoundaries,
|
||||||
|
} from "./tools/lib";
|
||||||
import { modifiedPolygon } from "./tools/tool-polygon";
|
import { modifiedPolygon } from "./tools/tool-polygon";
|
||||||
import { undoStack } from "./tools/tool-undo-redo";
|
import { undoStack } from "./tools/tool-undo-redo";
|
||||||
import { enablePinchZoom, onResize, setCanvasSize } from "./tools/tool-zoom";
|
import { enablePinchZoom, onResize, setCanvasSize } from "./tools/tool-zoom";
|
||||||
|
|
@ -83,6 +95,7 @@ export const setupMaskEditorForEdit = async (
|
||||||
window.requestAnimationFrame(() => {
|
window.requestAnimationFrame(() => {
|
||||||
onImageLoaded({ noteId: BigInt(noteId) });
|
onImageLoaded({ noteId: BigInt(noteId) });
|
||||||
});
|
});
|
||||||
|
if (get(opacityStateStore)) { makeMaskTransparent(canvas, true); }
|
||||||
};
|
};
|
||||||
|
|
||||||
return canvas;
|
return canvas;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue