Daishi Kato 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
2020-03-30 09:49:43 +02:00
2020-04-02 10:40:26 +02:00
2020-03-14 20:46:57 -07:00
2020-02-05 17:41:14 +01:00
2020-02-07 13:59:23 +01:00
2020-01-24 12:04:54 +02:00
2020-03-19 20:38:52 +02:00
2020-01-05 13:09:29 -08:00
2020-03-31 11:37:51 +03:00

Excalidraw logo: Sketch handrawn like diagrams.

Excalidraw is a whiteboard tool that lets you easily sketch diagrams with a hand-drawn feel.

Follow Excalidraw on Twitter

Try it now

Go to https://excalidraw.com to start sketching.

Run the code

Code Sandbox

Local Installation

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Clone the repo

git clone https://github.com/excalidraw/excalidraw.git

Commands

Command Description
npm install Install the dependencies
npm start Run the project
npm run fix Reformat all files with Prettier
npm run test:code Test for formatting with Prettier
npm run test:app Test the app
npm run test Run all tests

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Translating

To translate Excalidraw into other languages, please visit our Crowdin page. To add a new language, open an issue so we can get things set up on our end first.

Excalidraw is built using these awesome tools

And the main source of inspiration for starting the project is the awesome Zwibbler app.

Testimonials

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Description
No description provided
Readme 44 MiB
Languages
TypeScript 89.6%
SCSS 4.2%
MDX 3.5%
JavaScript 2.4%
HTML 0.2%