rough-stuff / rough

Create graphics with a hand-drawn, sketchy, appearance
http://roughjs.com
MIT License
19.88k stars 615 forks source link

Interoperability with Pencil #208

Open lppedd opened 2 years ago

lppedd commented 2 years ago

I'm trying to add a Sketchy Rough collection to Pencil. This is a box example:

example

You can see Pencil is able to drag only over SVG paths. Do you think there is a way we could overcome this issue?

lppedd commented 2 years ago

Done it. Just define an hidden background layer.

<Behaviors>
  <For ref="background">
    <Width>$box.w</Width>
    <Height>$box.h</Height>
  </For>
  ...
</Behaviors>
<p:Content xmlns:p="http://www.evolus.vn/Namespace/Pencil" xmlns="http://www.w3.org/2000/svg">
  <g style="fill-opacity: 0">
    <rect id="background" />
  </g>
  <g id="content" />
  <text id="text" />
</p:Content>

Keeping this open for others.

lppedd commented 2 years ago

Please refer to https://github.com/lppedd/pencil-sketchy-rough for contributions 😄