mirror of
https://github.com/YuzuZensai/Pien-Studio.git
synced 2026-09-02 14:18:35 +00:00
♻️ refactor!: massive refactor
This commit is contained in:
@@ -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 },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user