mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: better default radius sizes for rectangles (#5553)
Co-authored-by: Ryan <diweihao@bytedance.com> Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
65d84a5d5a
commit
5854ac3eed
39 changed files with 1861 additions and 818 deletions
|
@ -216,6 +216,32 @@ export const TEXT_ALIGN = {
|
|||
|
||||
export const ELEMENT_READY_TO_ERASE_OPACITY = 20;
|
||||
|
||||
// Radius represented as 25% of element's largest side (width/height).
|
||||
// Used for LEGACY and PROPORTIONAL_RADIUS algorithms, or when the element is
|
||||
// below the cutoff size.
|
||||
export const DEFAULT_PROPORTIONAL_RADIUS = 0.25;
|
||||
// Fixed radius for the ADAPTIVE_RADIUS algorithm. In pixels.
|
||||
export const DEFAULT_ADAPTIVE_RADIUS = 32;
|
||||
// roundness type (algorithm)
|
||||
export const ROUNDNESS = {
|
||||
// Used for legacy rounding (rectangles), which currently works the same
|
||||
// as PROPORTIONAL_RADIUS, but we need to differentiate for UI purposes and
|
||||
// forwards-compat.
|
||||
LEGACY: 1,
|
||||
|
||||
// Used for linear elements & diamonds
|
||||
PROPORTIONAL_RADIUS: 2,
|
||||
|
||||
// Current default algorithm for rectangles, using fixed pixel radius.
|
||||
// It's working similarly to a regular border-radius, but attemps to make
|
||||
// radius visually similar across differnt element sizes, especially
|
||||
// very large and very small elements.
|
||||
//
|
||||
// NOTE right now we don't allow configuration and use a constant radius
|
||||
// (see DEFAULT_ADAPTIVE_RADIUS constant)
|
||||
ADAPTIVE_RADIUS: 3,
|
||||
} as const;
|
||||
|
||||
export const COOKIES = {
|
||||
AUTH_STATE_COOKIE: "excplus-auth",
|
||||
} as const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue