Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PatWie/drafft-ink
/ functions
Functions
1,090 in github.com/PatWie/drafft-ink
⨍
Functions
1,090
◇
Types & classes
146
↓ 174 callers
Method
clone
(&self)
crates/drafftink-core/src/shapes/text.rs:114
↓ 94 callers
Method
show
Show the swatch and return (clicked, rect).
crates/drafftink-widgets/src/colors.rs:553
↓ 79 callers
Method
len
Get the number of points.
crates/drafftink-core/src/shapes/freehand.rs:96
↓ 74 callers
Method
len
Get the number of shapes.
crates/drafftink-core/src/canvas.rs:249
↓ 72 callers
Method
is_empty
Check if the document is empty.
crates/drafftink-core/src/canvas.rs:244
↓ 60 callers
Method
line_to
(&mut self, x: f32, y: f32)
crates/drafftink-render/src/rex_backend.rs:107
↓ 58 callers
Method
bounds
Get the bounding box of all shapes.
crates/drafftink-core/src/canvas.rs:203
↓ 54 callers
Method
id
(&self)
crates/drafftink-core/src/shapes/mod.rs:333
↓ 54 callers
Method
size
Set the size.
crates/drafftink-widgets/src/colors.rs:621
↓ 50 callers
Method
stroke
Get the stroke color as a peniko Color.
crates/drafftink-core/src/shapes/mod.rs:215
↓ 47 callers
Method
move_to
(&mut self, x: f32, y: f32)
crates/drafftink-render/src/rex_backend.rs:104
↓ 46 callers
Method
fill
Get the fill color as a peniko Color.
crates/drafftink-core/src/shapes/mod.rs:228
↓ 44 callers
Method
push_undo
Push current state to undo stack (call before making changes).
crates/drafftink-core/src/canvas.rs:73
↓ 43 callers
Method
get_shape_mut
Get a mutable reference to a shape by ID.
crates/drafftink-core/src/canvas.rs:157
↓ 38 callers
Method
get_shape
Get a shape by ID.
crates/drafftink-core/src/canvas.rs:152
↓ 37 callers
Method
add_shape
Add a shape to the document.
crates/drafftink-core/src/canvas.rs:133
↓ 36 callers
Method
clear_selection
Clear selection.
crates/drafftink-core/src/canvas.rs:470
↓ 36 callers
Method
height
Set the button height.
crates/drafftink-widgets/src/buttons.rs:226
↓ 35 callers
Function
get_double
Helper functions to extract values from LoroMapValue
crates/drafftink-core/src/crdt/convert.rs:82
↓ 26 callers
Method
transform
Get the affine transform for rendering. This transform converts world coordinates to screen coordinates.
crates/drafftink-core/src/camera.rs:46
↓ 25 callers
Method
is_empty
Check if the path is empty.
crates/drafftink-core/src/shapes/freehand.rs:101
↓ 20 callers
Function
get_i64
(map: &LoroMapValue, key: &str)
crates/drafftink-core/src/crdt/convert.rs:90
↓ 19 callers
Method
remove
Remove state for a deleted shape.
crates/drafftink-core/src/widget/manager.rs:161
↓ 19 callers
Method
screen_to_world
Convert a screen point to world coordinates.
crates/drafftink-core/src/camera.rs:58
↓ 18 callers
Method
clear
Clear all shapes from the document.
crates/drafftink-core/src/canvas.rs:146
↓ 18 callers
Method
offset
Random offset scaled by amount
crates/drafftink-render/src/vello_impl.rs:116
↓ 18 callers
Method
send
Send a text message.
crates/drafftink-core/src/sync.rs:329
↓ 17 callers
Method
add_to_selection
Add to selection.
crates/drafftink-core/src/canvas.rs:462
↓ 16 callers
Method
is_in_room
Check if we're in a room.
crates/drafftink-core/src/collaboration.rs:241
↓ 16 callers
Method
style
Set the style.
crates/drafftink-widgets/src/colors.rs:541
↓ 16 callers
Method
text
Get the current text content.
crates/drafftink-render/src/text_editor.rs:130
↓ 15 callers
Method
crdt_mut
Get a mutable reference to the CRDT document.
crates/drafftink-core/src/collaboration.rs:86
↓ 15 callers
Function
snap_to_grid
Snap a point to the nearest grid intersection.
crates/drafftink-core/src/snap.rs:559
↓ 14 callers
Function
broadcast_doc_changes
( collab: &mut CollaborationManager, document: &drafftink_core::canvas::CanvasDocument, websocket:
crates/drafftink-app/src/app.rs:1603
↓ 13 callers
Method
all_points
Get all points including start, intermediate, and end.
crates/drafftink-core/src/shapes/line.rs:103
↓ 13 callers
Function
parse
Parse the flowchart body into nodes, subgraph clusters, edges, and a top-level flow direction.
crates/drafftink-core/src/mermaid/flowchart.rs:165
↓ 13 callers
Method
set_tool
Set the current tool.
crates/drafftink-core/src/canvas.rs:515
↓ 13 callers
Method
to_path
(&self)
crates/drafftink-core/src/shapes/mod.rs:400
↓ 12 callers
Function
block_on
(f: F)
crates/drafftink-core/src/storage/file.rs:154
↓ 12 callers
Method
delete
Delete a document by ID.
crates/drafftink-core/src/storage/autosave.rs:142
↓ 12 callers
Method
hovered
Get the hovered shape ID (if any).
crates/drafftink-core/src/widget/manager.rs:76
↓ 12 callers
Function
normalize_label
Convert Mermaid label conventions into plain multi-line text: `<br>` and `<br/>` become newlines, and surrounding quotes are stripped.
crates/drafftink-core/src/mermaid/mod.rs:199
↓ 11 callers
Function
measure_text
Estimate the rendered `(width, height)` of a possibly multi-line label at the given font size. This is only an approximation used for box sizing; the
crates/drafftink-core/src/mermaid/mod.rs:184
↓ 11 callers
Function
menu_item
Menu item with label and shortcut - uses drafftink_widgets.
crates/drafftink-app/src/ui.rs:2464
↓ 11 callers
Method
selected
Set whether this swatch is selected.
crates/drafftink-widgets/src/colors.rs:535
↓ 10 callers
Function
base_style
Build the default stroke/fill style for diagram geometry.
crates/drafftink-core/src/mermaid/mod.rs:208
↓ 10 callers
Method
cursor_reset
Reset cursor to visible state and start blinking.
crates/drafftink-render/src/text_editor.rs:173
↓ 10 callers
Method
remove_shape
Remove a shape from the document.
crates/drafftink-core/src/canvas.rs:140
↓ 9 callers
Method
add_shape
Add a shape to the document.
crates/drafftink-core/src/crdt/schema.rs:86
↓ 9 callers
Function
block_on
(f: F)
crates/drafftink-core/src/storage/memory.rs:84
↓ 9 callers
Function
get_id
(map: &LoroMapValue)
crates/drafftink-core/src/crdt/convert.rs:112
↓ 9 callers
Method
set_width
Set the text width constraint.
crates/drafftink-render/src/text_editor.rs:168
↓ 9 callers
Method
shapes_at_point
Find shapes at a point (in world coordinates).
crates/drafftink-core/src/canvas.rs:216
↓ 9 callers
Method
shift
(&self)
crates/drafftink-core/src/input.rs:176
↓ 9 callers
Method
stroke_with_opacity
Get the stroke color with opacity applied.
crates/drafftink-core/src/shapes/mod.rs:220
↓ 9 callers
Method
style_mut
(&mut self)
crates/drafftink-core/src/shapes/mod.rs:428
↓ 9 callers
Method
take_outgoing
Take pending outgoing messages (drains the queue).
crates/drafftink-core/src/collaboration.rs:275
↓ 8 callers
Function
base64_decode
Base64 decoding
crates/drafftink-core/src/sync.rs:117
↓ 8 callers
Method
bounds
(&self)
crates/drafftink-core/src/shapes/mod.rs:347
↓ 8 callers
Method
font_size
Set the font size.
crates/drafftink-widgets/src/buttons.rs:232
↓ 8 callers
Method
mouse_position
(&self)
crates/drafftink-core/src/input.rs:127
↓ 8 callers
Function
parse
Parse the diagram body into participants and time-ordered events. Unknown or unsupported lines are skipped so arbitrary input never aborts the import.
crates/drafftink-core/src/mermaid/sequence.rs:125
↓ 8 callers
Method
select
Select a shape (clears previous selection).
crates/drafftink-core/src/canvas.rs:456
↓ 8 callers
Function
style_from_loro
(map: &LoroMapValue)
crates/drafftink-core/src/crdt/convert.rs:504
↓ 8 callers
Function
style_to_loro
Convert style properties to Loro map entries.
crates/drafftink-core/src/crdt/convert.rs:258
↓ 8 callers
Method
z_order_list
Get the z-order list.
crates/drafftink-core/src/crdt/schema.rs:64
↓ 7 callers
Function
apply_manipulation
Apply a handle manipulation to a shape. Returns the modified shape. `keep_aspect_ratio`: if true, maintains aspect ratio during corner resize (Shift k
crates/drafftink-core/src/selection.rs:440
↓ 7 callers
Method
clear
Clear all shapes from the document.
crates/drafftink-core/src/crdt/schema.rs:337
↓ 7 callers
Function
default_btn
Default button (frameless close button).
crates/drafftink-widgets/src/common.rs:28
↓ 7 callers
Method
driver
Create a driver for performing edit operations.
crates/drafftink-render/src/text_editor.rs:121
↓ 7 callers
Method
enable
Enable collaboration.
crates/drafftink-core/src/collaboration.rs:71
↓ 7 callers
Function
library_from_excalidrawlib
Parse an Excalidraw library file into named items, or `None` if the text is not a recognizable `excalidrawlib` document. Supports the v2 `libraryItems
crates/drafftink-core/src/excalidraw.rs:56
↓ 7 callers
Method
reset
Reset camera to default position and zoom.
crates/drafftink-core/src/camera.rs:92
↓ 7 callers
Method
rotation
Get the rotation angle in radians (0 for shapes that don't support rotation).
crates/drafftink-core/src/shapes/mod.rs:508
↓ 7 callers
Method
save
Force save the document immediately.
crates/drafftink-core/src/storage/autosave.rs:101
↓ 7 callers
Method
small
Small circular swatch (default)
crates/drafftink-widgets/src/colors.rs:492
↓ 7 callers
Method
to_json
Serialize the document to JSON.
crates/drafftink-core/src/canvas.rs:254
↓ 7 callers
Method
to_shape_style
Convert current UI style to ShapeStyle. Generates a new random seed for each shape created.
crates/drafftink-app/src/ui.rs:374
↓ 6 callers
Method
add_shape
Add a shape, syncing to CRDT if enabled.
crates/drafftink-core/src/collaboration.rs:140
↓ 6 callers
Method
begin
Begin a tool interaction.
crates/drafftink-core/src/tools/mod.rs:133
↓ 6 callers
Method
build_scene
(&mut self, ctx: &RenderContext)
crates/drafftink-render/src/vello_impl.rs:1629
↓ 6 callers
Method
cancel
Cancel any ongoing operation.
crates/drafftink-app/src/event_handler.rs:199
↓ 6 callers
Function
centered_text
Create a centered text shape whose bounding box is centered on `center`.
crates/drafftink-core/src/mermaid/mod.rs:234
↓ 6 callers
Method
pan
Pan the camera by a delta in screen coordinates.
crates/drafftink-core/src/camera.rs:68
↓ 6 callers
Function
panel_frame
Common panel frame style - uses drafftink_widgets.
crates/drafftink-app/src/ui.rs:2474
↓ 6 callers
Function
place_shapes_centered_at
Place a freshly imported/pasted set of shapes onto the canvas, centered on a world-space point, as a single undoable operation that also selects the r
crates/drafftink-app/src/app.rs:1645
↓ 6 callers
Function
rect_shape
Create a rectangle shape at `(x, y)` with the given size, corner radius and optional fill.
crates/drafftink-core/src/mermaid/mod.rs:219
↓ 6 callers
Function
save_document
Save document to a JSON file using native file dialog (async, non-blocking).
crates/drafftink-app/src/app.rs:42
↓ 6 callers
Method
shapes_map
Get the shapes map.
crates/drafftink-core/src/crdt/schema.rs:59
↓ 6 callers
Function
snap_line_endpoint_isometric
Snap a line endpoint considering both angle snapping and grid snapping. When BOTH angle_snap AND grid_snap are enabled: - Snaps to grid LINE intersec
crates/drafftink-core/src/snap.rs:713
↓ 6 callers
Method
zoom_at
Zoom the camera, keeping the given screen point fixed.
crates/drafftink-core/src/camera.rs:73
↓ 5 callers
Function
block_on
(f: F)
crates/drafftink-core/src/storage/autosave.rs:197
↓ 5 callers
Method
build_export_scene
Build a scene for export (shapes only, no grid/selection/guides). Returns the scene and the scaled bounds (for texture dimensions). `scale` is the ex
crates/drafftink-render/src/vello_impl.rs:384
↓ 5 callers
Method
build_export_scene_selection
Build a scene for exporting selected shapes only. `scale` is the export resolution multiplier (1 = 1x, 2 = 2x, 3 = 3x).
crates/drafftink-render/src/vello_impl.rs:436
↓ 5 callers
Method
contexts_mut
Get mutable references to both font and layout contexts for text editing.
crates/drafftink-render/src/vello_impl.rs:376
↓ 5 callers
Method
ctrl
(&self)
crates/drafftink-core/src/input.rs:180
↓ 5 callers
Method
fit_within
Scale the image to fit within max dimensions while preserving aspect ratio.
crates/drafftink-core/src/shapes/image.rs:158
↓ 5 callers
Method
get_db
Get or create the database connection.
crates/drafftink-core/src/storage/indexeddb.rs:21
↓ 5 callers
Function
get_handles
Get the selection handles for a shape.
crates/drafftink-core/src/selection.rs:73
↓ 5 callers
Function
get_string
(map: &LoroMapValue, key: &str)
crates/drafftink-core/src/crdt/convert.rs:98
next →
1–100 of 1,090, ranked by callers