4260f499c6
Fixes #1996 This fixes a few issues with cloud rendering: - At small sizes the arcs could get kind of inverted after being mutated, so you'd end calculating the outline using the large arc instead of the small arc and it would balloon the size of the bounds (that was what Mitja was seeing in #1996 - While working on the above I noticed that there are some situations where we were actually supposed to be using the large arc for rendering the svg paths but we were using the small arcs instead, making the bounds appear larger than the cloud shape when in fact the cloud shape was too small. - I also fixed some other issues related to rendering clouds with tiny width/height. It now draws straight lines instead of arcs if the arcs are essentially flat, and it increases the number of lumps when width or height are very small to avoid certain kinds of weirdness. ### Change Type - [x] `patch` — Bug fix - [ ] `minor` — New feature - [ ] `major` — Breaking change - [ ] `dependencies` — Changes to package dependencies[^1] - [ ] `documentation` — Changes to the documentation only[^2] - [ ] `tests` — Changes to any test code only[^2] - [ ] `internal` — Any other changes that don't affect the published package[^2] - [ ] I don't know [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Test Plan 1. Add a step-by-step description of how to test your PR here. 2. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - Improves cloud shape rendering |
||
---|---|---|
.github | ||
.husky | ||
.yarn | ||
apps | ||
assets | ||
config | ||
docs | ||
packages | ||
scripts | ||
.eslintignore | ||
.eslintplugin.js | ||
.eslintrc.js | ||
.gitignore | ||
.ignore | ||
.prettierignore | ||
.prettierrc | ||
.yarnrc.yml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
lazy.config.ts | ||
lerna.json | ||
LICENSE | ||
package.json | ||
public-yarn.lock | ||
README.md |
tldraw
Welcome to the public monorepo for tldraw.
What is tldraw?
tldraw is a collaborative digital whiteboard available at tldraw.com. Its editor, user interface, and other underlying libraries are open source and available in this repository. They are also distributed on npm. You can use tldraw to create a drop-in whiteboard for your product or as the foundation on which to build your own infinite canvas applications.
Learn more at tldraw.dev.
Note
This repo contains source code for the current version of tldraw. You can find the source for the original version here.
Installation & Usage
To learn more about using tldraw in your React application, follow our guide here or see the examples sandbox.
import { Tldraw } from '@tldraw/tldraw'
import '@tldraw/tldraw/tldraw.css'
export default function () {
return (
<div style={{ position: 'fixed', inset: 0 }}>
<Tldraw />
</div>
)
}
Local development
To run the local development server, first clone this repo.
Install dependencies:
yarn
Start the local development server:
yarn dev
Open the example project at localhost:5420
.
Examples
Our development server contains several examples that demonstrates different ways that you can customize tldraw or use its APIs. Each example is found in the apps/examples folder.
- eg:
localhost:5420
for the basic example. - eg:
localhost:5420/api
for the API example.
To learn more about using tldraw, visit our docs.
About this repository
Top-level layout
This repository's contents is divided across four primary sections:
/apps
contains the source for our applications/packages
contains the source for our public packages/scripts
contains scripts used for building and publishing/assets
contains icons and translations relied on by the app/docs
contains the content for our docs site at tldraw.dev
Applications
examples
: our local development / examples projectvscode
: our Visual Studio Code extension
Packages
assets
: a library for working with tldraw's fonts and translationseditor
: the tldraw editorstate
: a signals library, also known as signiastore
: an in-memory reactive databasetldraw
: the main tldraw package containing both the editor and the UItlschema
: shape definitions and migrationsutils
: low-level data utilities shared by other librariesvalidate
: a validation library used for run-time validation
Community
Have questions, comments or feedback? Join our discord or start a discussion.
Distributions
You can find tldraw on npm here.
At the moment the tldraw package is in alpha. We also ship a canary version which is always up to date with the main branch of this repo.
License
The source code for various apps and packages in this repository (as well as our 2.0+ distributions and releases) are currently licensed under Apache-2.0. These licenses are subject to change in our upcoming 2.0 release. If you are planning to use tldraw in a commercial product, please reach out at hello@tldraw.com.
Contribution
Please see our contributing guide. Found a bug? Please submit an issue.
Contact
Find us on Twitter at @tldraw or email hello@tldraw.com. You can also join our discord for quick help and support.