feat: add outline button and render text in canvas

This commit is contained in:
2026-02-19 08:19:44 +05:00
parent 833cc3d086
commit 48c7d8876a
4 changed files with 23 additions and 4 deletions
+2 -2
View File
@@ -31,8 +31,8 @@
{width} {width}
{height} {height}
fontSize={textConfigState.fontSize} fontSize={textConfigState.fontSize}
stroke={textConfigState.color} stroke={textConfigState.outlined ? textConfigState.color : "transparent"}
fill="transparent" fill={textConfigState.outlined ? "transparent" : textConfigState.color}
fontFamily={textConfigState.fontFamily} fontFamily={textConfigState.fontFamily}
align={textConfigState.align} align={textConfigState.align}
wrap="none" wrap="none"
+3 -1
View File
@@ -4,6 +4,7 @@
import SettingsRow from "$components/layout/SettingsRow.svelte"; import SettingsRow from "$components/layout/SettingsRow.svelte";
import Alignment from "$components/ui/Alignment.svelte"; import Alignment from "$components/ui/Alignment.svelte";
import ColorPicker from "$components/ui/ColorPicker.svelte"; import ColorPicker from "$components/ui/ColorPicker.svelte";
import Outline from "$components/ui/Outline.svelte";
import RangeSlider from "$components/ui/RangeSlider.svelte"; import RangeSlider from "$components/ui/RangeSlider.svelte";
import SelectFont from "$components/ui/SelectFont.svelte"; import SelectFont from "$components/ui/SelectFont.svelte";
import { TYPOGRAPHY } from "$lib/constants"; import { TYPOGRAPHY } from "$lib/constants";
@@ -23,8 +24,9 @@
<SettingsRow label="Шрифт"> <SettingsRow label="Шрифт">
<SelectFont bind:value={textConfigState.fontFamily} /> <SelectFont bind:value={textConfigState.fontFamily} />
</SettingsRow> </SettingsRow>
<SettingsRow label="Цвет"> <SettingsRow label="Цвет" noLabel={true}>
<ColorPicker bind:value={textConfigState.color} /> <ColorPicker bind:value={textConfigState.color} />
<Outline bind:outlined={textConfigState.outlined} />
</SettingsRow> </SettingsRow>
<SettingsRow label="Выравнивание" noLabel={true}> <SettingsRow label="Выравнивание" noLabel={true}>
<Alignment bind:align={textConfigState.align} /> <Alignment bind:align={textConfigState.align} />
+1 -1
View File
@@ -44,7 +44,7 @@
--btn-main: var(--action-primary); --btn-main: var(--action-primary);
--btn-hover: var(--action-primary-hover); --btn-hover: var(--action-primary-hover);
padding: 10px 16px; padding: 10px 16px;
border: none; border: 1px solid var(--btn-main);
border-radius: var(--radius); border-radius: var(--radius);
font-size: 13px; font-size: 13px;
font-weight: 500; font-weight: 500;
+17
View File
@@ -0,0 +1,17 @@
<script lang="ts">
import TypeOutline from "~icons/lucide/type-outline";
import Button from "./Button.svelte";
interface Props {
outlined: boolean;
}
let { outlined = $bindable(false) }: Props = $props();
</script>
<Button
icon={TypeOutline}
ariaLabel="toggle outline"
onclick={() => (outlined = !outlined)}
type={outlined ? "outline" : "primary"}
/>