mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
Merge branch 'feature/flip-button' of https://github.com/Mohammad-Alshabout/anki into feature/flip-button
This commit is contained in:
commit
dcbb567267
7 changed files with 12 additions and 2 deletions
|
|
@ -232,6 +232,7 @@ Spiritual Father <https://github.com/spiritualfather>
|
|||
Emmanuel Ferdman <https://github.com/emmanuel-ferdman>
|
||||
Sunong2008 <https://github.com/Sunrongguo2008>
|
||||
Marvin Kopf <marvinkopf@outlook.com>
|
||||
mohammad.alshabout, at the domain student.jade-hs.de
|
||||
********************
|
||||
|
||||
The text of the 3 clause BSD license follows:
|
||||
|
|
|
|||
|
|
@ -1791,6 +1791,7 @@ def set_image_occlusion_button(editor: Editor) -> None:
|
|||
gui_hooks.editor_did_load_note.append(set_cloze_button)
|
||||
gui_hooks.editor_did_load_note.append(set_image_occlusion_button)
|
||||
|
||||
|
||||
def add_flip_button(buttons, editor: Editor):
|
||||
|
||||
def on_flip(editor: Editor):
|
||||
|
|
@ -1816,9 +1817,10 @@ def add_flip_button(buttons, editor: Editor):
|
|||
func=on_flip,
|
||||
tip="Front/Back Felder vertauschen",
|
||||
label="↔",
|
||||
id="flip_fields_button"
|
||||
id="flip_fields_button",
|
||||
)
|
||||
buttons.append(btn)
|
||||
return buttons
|
||||
|
||||
|
||||
gui_hooks.editor_did_init_buttons.append(add_flip_button)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ export class Shape {
|
|||
left: floatToDisplay(this.left),
|
||||
top: floatToDisplay(this.top),
|
||||
...(!angle ? {} : { angle: angle.toString() }),
|
||||
...(this.fill === SHAPE_MASK_COLOR ? {} : { fill: this.fill }),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import { fabric } from "fabric";
|
||||
|
||||
import { SHAPE_MASK_COLOR } from "../tools/lib";
|
||||
import type { ConstructorParams, Size } from "../types";
|
||||
import type { ShapeDataForCloze } from "./base";
|
||||
import { Shape } from "./base";
|
||||
|
|
@ -25,6 +26,7 @@ export class Ellipse extends Shape {
|
|||
...super.toDataForCloze(),
|
||||
rx: floatToDisplay(this.rx),
|
||||
ry: floatToDisplay(this.ry),
|
||||
...(this.fill === SHAPE_MASK_COLOR ? {} : { fill: this.fill }),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import { fabric } from "fabric";
|
||||
|
||||
import { SHAPE_MASK_COLOR } from "../tools/lib";
|
||||
import type { ConstructorParams, Size } from "../types";
|
||||
import type { ShapeDataForCloze } from "./base";
|
||||
import { Shape } from "./base";
|
||||
|
|
@ -22,6 +23,7 @@ export class Polygon extends Shape {
|
|||
return {
|
||||
...super.toDataForCloze(),
|
||||
points: this.points.map(({ x, y }) => `${floatToDisplay(x)},${floatToDisplay(y)}`).join(" "),
|
||||
...(this.fill === SHAPE_MASK_COLOR ? {} : { fill: this.fill }),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import { fabric } from "fabric";
|
||||
|
||||
import { SHAPE_MASK_COLOR } from "../tools/lib";
|
||||
import type { ConstructorParams, Size } from "../types";
|
||||
import type { ShapeDataForCloze } from "./base";
|
||||
import { Shape } from "./base";
|
||||
|
|
@ -25,6 +26,7 @@ export class Rectangle extends Shape {
|
|||
...super.toDataForCloze(),
|
||||
width: floatToDisplay(this.width),
|
||||
height: floatToDisplay(this.height),
|
||||
...(this.fill === SHAPE_MASK_COLOR ? {} : { fill: this.fill }),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import {
|
|||
isPointerInBoundingBox,
|
||||
stopDraw,
|
||||
TEXT_BACKGROUND_COLOR,
|
||||
TEXT_COLOR,
|
||||
TEXT_FONT_FAMILY,
|
||||
TEXT_PADDING,
|
||||
} from "./lib";
|
||||
|
|
@ -41,6 +42,7 @@ export const drawText = (canvas: fabric.Canvas, onActivated: Callback): void =>
|
|||
selectable: true,
|
||||
strokeWidth: 1,
|
||||
noScaleCache: false,
|
||||
fill: TEXT_COLOR,
|
||||
fontFamily: TEXT_FONT_FAMILY,
|
||||
backgroundColor: TEXT_BACKGROUND_COLOR,
|
||||
padding: TEXT_PADDING,
|
||||
|
|
|
|||
Loading…
Reference in a new issue