Commit Graph
29 Commits
Author SHA1 Message Date
Daishi KatoandGitHub 4b32c03994 feat: export exportToCanvas in utils (#2583) 2020-12-14 14:11:48 +01:00
84c49ebaa1 Support rotating two-point lines (angle can be non-zero) (#2090)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-08-28 10:20:06 +02:00
41cb1fbeba feat: sharpness (#1931)
* feat: sharpness

* feat: fill sharp lines, et al.

* fix: rotated positioning

* chore: simplify path with Q

* fix: hit test inside sharp elements

* make sharp / round buttons work properly

* fix tsc tests

* update snapshots

* update snapshots

* fix: sharp arrow creation error

* fix merge and test

* avoid type assertion

* remove duplicate helper

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-08-14 17:59:43 +02:00
Daishi KatoandGitHub 818821c293 feat: grid mode for line editing (#1984) 2020-07-30 17:09:51 +02:00
Daishi KatoandGitHub a2e7d8d560 feat: rotating multiple elements (#1960) 2020-07-26 12:21:38 +02:00
6cc6e13892 adjust font baseline on resize (#1820)
* adjust font baseline on resize

* simplify font scaling on resize

* fix: resizing text to avoid glitchy behavior

* make text resizing deterministic

* no TEXT_WIDTH_PADDING hack

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-07-09 22:22:10 +09:00
9c89504b6f fix: start dragging grouped elements (#1818)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-06-24 13:38:42 +02:00
Daishi KatoandGitHub caa9b54893 do not render grid on export (#1814) 2020-06-24 10:16:03 +02:00
baa8fb6c14 grid support (1st iteration) (#1788)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-06-23 17:24:52 +02:00
Daishi KatoandGitHub 482fa2d90f fix visibility check on rotated elements (#1799) 2020-06-22 10:00:09 +02:00
53ab46126d support resizing multiple elements including texts (#1726)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-06-08 11:25:20 +02:00
7edcea9a93 feat: resize text element (#1650)
* feat: resize text element

* ignore small font size change that leads jankiness

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-05-28 07:17:15 +09:00
Daishi KatoandGitHub 51608c07b0 15-degree rotation locking (#1627) 2020-05-23 10:45:05 +02:00
Daishi KatoandGitHub 4d2e8f9ad1 feat: resize multiple elements including two-point lines (#1607) 2020-05-18 10:36:30 +02:00
Daishi KatoandGitHub 6b628bb1a6 fix: resize non solid lines/arrows/draws (#1608) 2020-05-17 16:01:35 +02:00
Daishi KatoandGitHub f6be200388 feat: resize multiple curved lines (#1596) 2020-05-14 16:56:14 +02:00
Daishi KatoandGitHub 394237728f Refactor: resize two-point lines/arrows (#1568) 2020-05-10 17:41:36 +02:00
Daishi KatoandGitHub 3b1d6910aa fix resizing: dynamic pointer offset for better UX (#1560) 2020-05-09 10:57:00 +02:00
Daishi KatoandGitHub 73d8c5b7c1 fix resizing lines with abs coords bigger than element w/h (#1427) 2020-05-04 17:25:40 +02:00
Daishi KatoandGitHub da1031aeb4 Fix resize logic (partly) (#1475) 2020-04-27 10:30:19 +02:00
Daishi KatoandGitHub 8c49770e3b Better resize cursors on rotated elements (#1470)
* better resize cursor on rotated elements

* refactor with Math.round
2020-04-22 15:11:01 +02:00
Daishi KatoandGitHub e77e2255bd Add test for getElementBounds (#1395)
* fix calc diamond bounds

* Add test for getElementBounds

* use toEqual
2020-04-13 17:47:09 -07:00
Daishi KatoandGitHub 038cff8793 fix calc diamond bounds (#1394) 2020-04-11 18:19:01 -07:00
Daishi KatoandGitHub 5ca763cdbb Calculate rotated element bounds properly (#1354)
* Calculate rotated element bounds properly, fixes #1303

* prefer isLinearElement

* empty commit
2020-04-11 13:10:47 +02:00
c3b83fba38 fix detecting rotated elements with selection (#1273)
* fix #1232

* Update src/element/bounds.ts

* prefer arrow functions

* fix merging

Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-07 16:04:20 +02:00
Daishi KatoandGitHub 2cc1105ff5 Resize multiple elements (rectangles, diamonds and ellipses onl… (#1193)
* experiment resizing multiple elements

* hack common component

* calculate scale properly (still se only)fg

* prioritize multi selection

* take handle offset into calculation

* fix master merge

* refactor resizeElements out from App

* wip: handlerRectanglesFromCoords

* fix test with type assertion

* properly show handles wip

* revert previous one and do a tweak

* remove unnecessary assignments

* replace hack code with good one

* refactor coords in arg

* resize NW

* resize from sw,ne

* fix with setResizeHandle

* do not show hint while resizing multiple elements

* empty commit

* fix format
2020-04-07 10:49:59 +02:00
Daishi KatoandGitHub 4003fa24b2 fix #1254 (#1255) 2020-04-05 20:54:27 -07:00
Daishi KatoandGitHub 44f871de71 do not select deleted elements (#1215) 2020-04-04 12:27:34 +02:00
65be7973be Rotation support (#1099)
* rotate rectanble with fixed angle

* rotate dashed rectangle with fixed angle

* fix rotate handler rect

* fix canvas size with rotation

* angle in element base

* fix bug in calculating canvas size

* trial only for rectangle

* hitTest for rectangle rotation

* properly resize rotated rectangle

* fix canvas size calculation

* giving up... workaround for now

* **experimental** handler to rotate rectangle

* remove rotation on copy for debugging

* update snapshots

* better rotation handler with atan2

* rotate when drawImage

* add rotation handler

* hitTest for any shapes

* fix hitTest for curved lines

* rotate text element

* rotation locking

* hint messaage for rotating

* show proper handlers on mobile (a workaround, there should be a better way)

* refactor hitTest

* support exporting png

* support exporting svg

* fix rotating curved line

* refactor drawElementFromCanvas with getElementAbsoluteCoords

* fix export png and svg

* adjust resize positions for lines (N, E, S, W)

* do not make handlers big on mobile

* Update src/locales/en.json

Alright!

Co-Authored-By: Lipis <lipiridis@gmail.com>

* do not show rotation/resizing hints on mobile

* proper calculation for N and W positions

* simplify calculation

* use "rotation" as property name for clarification (may increase bundle size)

* update snapshots excluding rotation handle

* refactor with adjustPositionWithRotation

* refactor with adjustXYWithRotation

* forgot to rename rotation

* rename internal function

* initialize element angle on restore

* rotate wysiwyg editor

* fix shift-rotate around 270deg

* improve rotation locking

* refactor adjustXYWithRotation

* avoid rotation degree becomes >=360

* refactor with generateHandler

Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-02 10:40:26 +02:00