mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-10 05:10:57 +08:00
Bezier-rs: Add project function for Subpaths (#914)
* Added subpath project function * Set appropriate project default in single manipulator group case * Lint * Return optional from subpath project + stylistic changes per review Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
0d703e857b
commit
72cd204c64
@@ -19,7 +19,13 @@
|
||||
|
||||
<h2>Subpaths</h2>
|
||||
<div v-for="(feature, index) in subpathFeatures" :key="index">
|
||||
<SubpathExamplePane :name="feature.name" :callback="feature.callback" :sliderOptions="feature.sliderOptions" :chooseComputeType="feature.chooseComputeType" />
|
||||
<SubpathExamplePane
|
||||
:name="feature.name"
|
||||
:callback="feature.callback"
|
||||
:sliderOptions="feature.sliderOptions"
|
||||
:triggerOnMouseMove="feature.triggerOnMouseMove"
|
||||
:chooseComputeType="feature.chooseComputeType"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -605,6 +611,12 @@ export default defineComponent({
|
||||
sliderOptions: [{ ...tSliderOptions, variable: "computeArgument" }],
|
||||
chooseComputeType: true,
|
||||
},
|
||||
{
|
||||
name: "Project",
|
||||
callback: (subpath: WasmSubpathInstance, _: Record<string, number>, mouseLocation?: [number, number]): string =>
|
||||
mouseLocation ? subpath.project(mouseLocation[0], mouseLocation[1]) : subpath.to_svg(),
|
||||
triggerOnMouseMove: true,
|
||||
},
|
||||
{
|
||||
name: "Intersect (Line Segment)",
|
||||
callback: (subpath: WasmSubpathInstance): string =>
|
||||
|
||||
Reference in New Issue
Block a user