♻️ refactor!: massive refactor

This commit is contained in:
2026-05-31 03:04:30 +07:00
parent c1f12c7201
commit df3c944547
86 changed files with 3691 additions and 1129 deletions
+15 -3
View File
@@ -9,13 +9,22 @@ describe("brush painter pure helpers", () => {
});
it("clamps invalid brush options", () => {
expect(clampBrushOptions({ color: "#fff", size: 0, opacity: 2, hardness: -1 })).toEqual({
expect(
clampBrushOptions({ color: "#fff", size: 0, opacity: 2, hardness: -1 }),
).toEqual({
color: "#fff",
size: 1,
opacity: 1,
hardness: 0,
});
expect(clampBrushOptions({ color: "#000", size: Number.NaN, opacity: Number.NaN, hardness: Number.NaN })).toEqual({
expect(
clampBrushOptions({
color: "#000",
size: Number.NaN,
opacity: Number.NaN,
hardness: Number.NaN,
}),
).toEqual({
color: "#000",
size: 1,
opacity: 1,
@@ -31,6 +40,9 @@ describe("brush painter pure helpers", () => {
{ x: 3, y: 0 },
{ x: 4, y: 0 },
]);
expect(buildBrushDabs(2, 3, 2, 3, 10)).toEqual([{ x: 2, y: 3 }, { x: 2, y: 3 }]);
expect(buildBrushDabs(2, 3, 2, 3, 10)).toEqual([
{ x: 2, y: 3 },
{ x: 2, y: 3 },
]);
});
});