Skip to content

Commit 60079f1

Browse files
committed
Release 2.0.0
1 parent a4c434c commit 60079f1

File tree

16 files changed

+13
-43
lines changed

16 files changed

+13
-43
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# lazy-brush - smooth drawing with a mouse, finger or any pointing device
22

3+
![lazy-brush banner](public/og.png?raw=true "Lazy Brush in action")
4+
35
**[Demo drawing app](https://lazybrush.dulnan.net)**
46

57
__The demo app also uses

demo-src/components/Icons/Github.vue

Lines changed: 0 additions & 13 deletions
This file was deleted.

demo-src/components/Icons/Menu.vue

Lines changed: 0 additions & 12 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

demo-src/components/Scene.vue renamed to demo/components/Scene.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
2222
import LazyBrush from '../../src/LazyBrush'
2323
import { Point } from '../../src/LazyPoint'
24-
import { Catenary } from 'catenary-curve'
24+
import { getCatenaryCurve, drawResult } from 'catenary-curve'
2525
2626
const DRAW_MAX_DPI = 2
2727
@@ -82,8 +82,6 @@ const lazy = new LazyBrush({
8282
}
8383
})
8484
85-
const catenary = new Catenary()
86-
8785
function onMouseDown() {
8886
isPressing.value = true
8987
}
@@ -186,12 +184,12 @@ function drawInterface() {
186184
ctx.setLineDash([5 * stretchFactor, 5 * stretchFactor])
187185
ctx.strokeStyle =
188186
pullOffset > -0.1 ? styleVariables.colorCatenary : 'rgba(0,0,0,0.3)'
189-
catenary.drawToCanvas(
190-
ctx,
187+
const result = getCatenaryCurve(
191188
brush,
192189
{ x: x.value, y: y.value },
193190
props.lazyRadius
194191
)
192+
drawResult(result, ctx)
195193
ctx.stroke()
196194
}
197195

demo-src/components/Sidebar.vue renamed to demo/components/Sidebar.vue

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@
2626
</template>
2727

2828
<script lang="ts" setup>
29-
defineEmits(['update:enabled', 'clear'])
30-
31-
defineProps({
32-
enabled: {
33-
type: Boolean,
34-
default: false
35-
}
36-
})
37-
3829
const links = [
3930
{
4031
href: 'https://github.com/dulnan/lazy-brush',
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
</head>
4242
<body>
4343
<div id="app"></div>
44-
<script type="module" src="/demo-src/index.ts"></script>
44+
<script type="module" src="/demo/index.ts"></script>
4545
</body>
4646
</html>

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "lazy-brush",
3-
"version": "1.0.1",
3+
"version": "2.0.0",
44
"description": "Lazy brush - smooth drawing using mouse or finger",
55
"type": "module",
66
"files": [
77
"lib"
88
],
99
"main": "./lib/lazy-brush.umd.cjs",
1010
"module": "./lib/lazy-brush.js",
11+
"types": "./lib/main.d.ts",
1112
"exports": {
1213
".": {
1314
"import": "./lib/lazy-brush.js",
@@ -41,7 +42,7 @@
4142
"@types/node": "^18.11.18",
4243
"@vitejs/plugin-vue": "^4.0.0",
4344
"autoprefixer": "^10.4.13",
44-
"catenary-curve": "^1.0.1",
45+
"catenary-curve": "^2.0.0",
4546
"postcss": "^8.4.20",
4647
"prettier": "^2.8.1",
4748
"sass": "^1.57.1",

public/_redirects

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://lazy-brush.netlify.app https://lazybrush.dulnan.net
2+
https://lazy-brush.netlify.app/ https://lazybrush.dulnan.net/

tailwind.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
module.exports = {
33
content: [
44
"./index.html",
5-
"./demo-src/**/*.{vue,js,ts,jsx,tsx}",
5+
"./demo/**/*.{vue,js,ts,jsx,tsx}",
66
],
77
theme: {
88
extend: {

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default defineConfig({
88
insertTypesEntry: true
99
})
1010
],
11+
publicDir: false,
1112
build: {
1213
outDir: 'lib',
1314
lib: {

0 commit comments

Comments
 (0)