mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Make IO polygon markers centred and transparent (#3989)
* make polygon markers centred and transparent
* centre active line
* set perPixelTargetFind per object, and not on the canvas
otherwise it can't be overridden for a specific object
see 4c305baae6/src/canvas.class.js (L786)
This commit is contained in:
parent
9025202204
commit
5cc44b3f68
2 changed files with 9 additions and 8 deletions
|
@ -95,7 +95,7 @@ function initCanvas(): fabric.Canvas {
|
||||||
undoStack.setCanvas(canvas);
|
undoStack.setCanvas(canvas);
|
||||||
// find object per-pixel basis rather than according to bounding box,
|
// find object per-pixel basis rather than according to bounding box,
|
||||||
// allow click through transparent area
|
// allow click through transparent area
|
||||||
canvas.perPixelTargetFind = true;
|
fabric.Object.prototype.perPixelTargetFind = true;
|
||||||
// Disable uniform scaling
|
// Disable uniform scaling
|
||||||
canvas.uniformScaling = false;
|
canvas.uniformScaling = false;
|
||||||
canvas.uniScaleKey = "none";
|
canvas.uniScaleKey = "none";
|
||||||
|
|
|
@ -87,22 +87,23 @@ const addPoint = (canvas: fabric.Canvas, options): void => {
|
||||||
|
|
||||||
const point = new fabric.Circle({
|
const point = new fabric.Circle({
|
||||||
radius: 5,
|
radius: 5,
|
||||||
fill: "#ffffff",
|
fill: "transparent",
|
||||||
stroke: "#333333",
|
stroke: "#333333",
|
||||||
strokeWidth: 0.5,
|
strokeWidth: 1.5,
|
||||||
originX: "left",
|
originX: "center",
|
||||||
originY: "top",
|
originY: "center",
|
||||||
left: origX,
|
left: origX,
|
||||||
top: origY,
|
top: origY,
|
||||||
selectable: false,
|
selectable: false,
|
||||||
hasBorders: false,
|
hasBorders: false,
|
||||||
hasControls: false,
|
hasControls: false,
|
||||||
objectCaching: false,
|
objectCaching: false,
|
||||||
|
perPixelTargetFind: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (pointsList.length === 0) {
|
if (pointsList.length === 0) {
|
||||||
point.set({
|
point.set({
|
||||||
fill: "red",
|
stroke: "red",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,8 +113,8 @@ const addPoint = (canvas: fabric.Canvas, options): void => {
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
fill: "#999999",
|
fill: "#999999",
|
||||||
stroke: "#999999",
|
stroke: "#999999",
|
||||||
originX: "left",
|
originX: "center",
|
||||||
originY: "top",
|
originY: "center",
|
||||||
selectable: false,
|
selectable: false,
|
||||||
hasBorders: false,
|
hasBorders: false,
|
||||||
hasControls: false,
|
hasControls: false,
|
||||||
|
|
Loading…
Reference in a new issue