Skip to content

Commit

Permalink
rename to unify mouse event name; bump 0.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Nov 20, 2020
1 parent cd680ec commit 3e8261c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ data: Data # JSON
x: 1
y: 1
radius: 20
events: ["touch-down", "touch-up", "touch-motion"]
events: ["mouse-down", "mouse-up", "mouse-move"]
```

### Events
Expand Down
2 changes: 1 addition & 1 deletion json_paint.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.0.13"
version = "0.0.14"
author = "jiyinyiyong"
description = "JSON DSL for canvas rendering"
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions src/json_paint/touches.nim
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ proc addTouchArea*(x: float, y: float, radius: float, tree: JsonNode) =
for item in tree["events"].elems:
if item.kind == JString:
case item.getStr
of "touch-down":
of "mouse-down":
events.incl(touchDown)
of "touch-up":
of "mouse-up":
events.incl(touchUp)
of "touch-motion":
of "mouse-move":
events.incl(touchMotion)
else:
showError("Unexpected event: " & item.getStr)
Expand Down
2 changes: 1 addition & 1 deletion tests/demo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ proc renderSomething() =
"y": 80,
"path": ["a", 1],
"action": ":demo",
"events": ["touch-down", "touch-motion"]
"events": ["mouse-down", "mouse-move"]
},
]
})
Expand Down

0 comments on commit 3e8261c

Please sign in to comment.