MCPcopy Create free account

hub / github.com/PatWie/drafft-ink / functions

Functions1,090 in github.com/PatWie/drafft-ink

↓ 174 callersMethodclone
(&self)
crates/drafftink-core/src/shapes/text.rs:114
↓ 94 callersMethodshow
Show the swatch and return (clicked, rect).
crates/drafftink-widgets/src/colors.rs:553
↓ 79 callersMethodlen
Get the number of points.
crates/drafftink-core/src/shapes/freehand.rs:96
↓ 74 callersMethodlen
Get the number of shapes.
crates/drafftink-core/src/canvas.rs:249
↓ 72 callersMethodis_empty
Check if the document is empty.
crates/drafftink-core/src/canvas.rs:244
↓ 60 callersMethodline_to
(&mut self, x: f32, y: f32)
crates/drafftink-render/src/rex_backend.rs:107
↓ 58 callersMethodbounds
Get the bounding box of all shapes.
crates/drafftink-core/src/canvas.rs:203
↓ 54 callersMethodid
(&self)
crates/drafftink-core/src/shapes/mod.rs:333
↓ 54 callersMethodsize
Set the size.
crates/drafftink-widgets/src/colors.rs:621
↓ 50 callersMethodstroke
Get the stroke color as a peniko Color.
crates/drafftink-core/src/shapes/mod.rs:215
↓ 47 callersMethodmove_to
(&mut self, x: f32, y: f32)
crates/drafftink-render/src/rex_backend.rs:104
↓ 46 callersMethodfill
Get the fill color as a peniko Color.
crates/drafftink-core/src/shapes/mod.rs:228
↓ 44 callersMethodpush_undo
Push current state to undo stack (call before making changes).
crates/drafftink-core/src/canvas.rs:73
↓ 43 callersMethodget_shape_mut
Get a mutable reference to a shape by ID.
crates/drafftink-core/src/canvas.rs:157
↓ 38 callersMethodget_shape
Get a shape by ID.
crates/drafftink-core/src/canvas.rs:152
↓ 37 callersMethodadd_shape
Add a shape to the document.
crates/drafftink-core/src/canvas.rs:133
↓ 36 callersMethodclear_selection
Clear selection.
crates/drafftink-core/src/canvas.rs:470
↓ 36 callersMethodheight
Set the button height.
crates/drafftink-widgets/src/buttons.rs:226
↓ 35 callersFunctionget_double
Helper functions to extract values from LoroMapValue
crates/drafftink-core/src/crdt/convert.rs:82
↓ 26 callersMethodtransform
Get the affine transform for rendering. This transform converts world coordinates to screen coordinates.
crates/drafftink-core/src/camera.rs:46
↓ 25 callersMethodis_empty
Check if the path is empty.
crates/drafftink-core/src/shapes/freehand.rs:101
↓ 20 callersFunctionget_i64
(map: &LoroMapValue, key: &str)
crates/drafftink-core/src/crdt/convert.rs:90
↓ 19 callersMethodremove
Remove state for a deleted shape.
crates/drafftink-core/src/widget/manager.rs:161
↓ 19 callersMethodscreen_to_world
Convert a screen point to world coordinates.
crates/drafftink-core/src/camera.rs:58
↓ 18 callersMethodclear
Clear all shapes from the document.
crates/drafftink-core/src/canvas.rs:146
↓ 18 callersMethodoffset
Random offset scaled by amount
crates/drafftink-render/src/vello_impl.rs:116
↓ 18 callersMethodsend
Send a text message.
crates/drafftink-core/src/sync.rs:329
↓ 17 callersMethodadd_to_selection
Add to selection.
crates/drafftink-core/src/canvas.rs:462
↓ 16 callersMethodis_in_room
Check if we're in a room.
crates/drafftink-core/src/collaboration.rs:241
↓ 16 callersMethodstyle
Set the style.
crates/drafftink-widgets/src/colors.rs:541
↓ 16 callersMethodtext
Get the current text content.
crates/drafftink-render/src/text_editor.rs:130
↓ 15 callersMethodcrdt_mut
Get a mutable reference to the CRDT document.
crates/drafftink-core/src/collaboration.rs:86
↓ 15 callersFunctionsnap_to_grid
Snap a point to the nearest grid intersection.
crates/drafftink-core/src/snap.rs:559
↓ 14 callersFunctionbroadcast_doc_changes
( collab: &mut CollaborationManager, document: &drafftink_core::canvas::CanvasDocument, websocket:
crates/drafftink-app/src/app.rs:1603
↓ 13 callersMethodall_points
Get all points including start, intermediate, and end.
crates/drafftink-core/src/shapes/line.rs:103
↓ 13 callersFunctionparse
Parse the flowchart body into nodes, subgraph clusters, edges, and a top-level flow direction.
crates/drafftink-core/src/mermaid/flowchart.rs:165
↓ 13 callersMethodset_tool
Set the current tool.
crates/drafftink-core/src/canvas.rs:515
↓ 13 callersMethodto_path
(&self)
crates/drafftink-core/src/shapes/mod.rs:400
↓ 12 callersFunctionblock_on
(f: F)
crates/drafftink-core/src/storage/file.rs:154
↓ 12 callersMethoddelete
Delete a document by ID.
crates/drafftink-core/src/storage/autosave.rs:142
↓ 12 callersMethodhovered
Get the hovered shape ID (if any).
crates/drafftink-core/src/widget/manager.rs:76
↓ 12 callersFunctionnormalize_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 callersFunctionmeasure_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 callersFunctionmenu_item
Menu item with label and shortcut - uses drafftink_widgets.
crates/drafftink-app/src/ui.rs:2464
↓ 11 callersMethodselected
Set whether this swatch is selected.
crates/drafftink-widgets/src/colors.rs:535
↓ 10 callersFunctionbase_style
Build the default stroke/fill style for diagram geometry.
crates/drafftink-core/src/mermaid/mod.rs:208
↓ 10 callersMethodcursor_reset
Reset cursor to visible state and start blinking.
crates/drafftink-render/src/text_editor.rs:173
↓ 10 callersMethodremove_shape
Remove a shape from the document.
crates/drafftink-core/src/canvas.rs:140
↓ 9 callersMethodadd_shape
Add a shape to the document.
crates/drafftink-core/src/crdt/schema.rs:86
↓ 9 callersFunctionblock_on
(f: F)
crates/drafftink-core/src/storage/memory.rs:84
↓ 9 callersFunctionget_id
(map: &LoroMapValue)
crates/drafftink-core/src/crdt/convert.rs:112
↓ 9 callersMethodset_width
Set the text width constraint.
crates/drafftink-render/src/text_editor.rs:168
↓ 9 callersMethodshapes_at_point
Find shapes at a point (in world coordinates).
crates/drafftink-core/src/canvas.rs:216
↓ 9 callersMethodshift
(&self)
crates/drafftink-core/src/input.rs:176
↓ 9 callersMethodstroke_with_opacity
Get the stroke color with opacity applied.
crates/drafftink-core/src/shapes/mod.rs:220
↓ 9 callersMethodstyle_mut
(&mut self)
crates/drafftink-core/src/shapes/mod.rs:428
↓ 9 callersMethodtake_outgoing
Take pending outgoing messages (drains the queue).
crates/drafftink-core/src/collaboration.rs:275
↓ 8 callersFunctionbase64_decode
Base64 decoding
crates/drafftink-core/src/sync.rs:117
↓ 8 callersMethodbounds
(&self)
crates/drafftink-core/src/shapes/mod.rs:347
↓ 8 callersMethodfont_size
Set the font size.
crates/drafftink-widgets/src/buttons.rs:232
↓ 8 callersMethodmouse_position
(&self)
crates/drafftink-core/src/input.rs:127
↓ 8 callersFunctionparse
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 callersMethodselect
Select a shape (clears previous selection).
crates/drafftink-core/src/canvas.rs:456
↓ 8 callersFunctionstyle_from_loro
(map: &LoroMapValue)
crates/drafftink-core/src/crdt/convert.rs:504
↓ 8 callersFunctionstyle_to_loro
Convert style properties to Loro map entries.
crates/drafftink-core/src/crdt/convert.rs:258
↓ 8 callersMethodz_order_list
Get the z-order list.
crates/drafftink-core/src/crdt/schema.rs:64
↓ 7 callersFunctionapply_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 callersMethodclear
Clear all shapes from the document.
crates/drafftink-core/src/crdt/schema.rs:337
↓ 7 callersFunctiondefault_btn
Default button (frameless close button).
crates/drafftink-widgets/src/common.rs:28
↓ 7 callersMethoddriver
Create a driver for performing edit operations.
crates/drafftink-render/src/text_editor.rs:121
↓ 7 callersMethodenable
Enable collaboration.
crates/drafftink-core/src/collaboration.rs:71
↓ 7 callersFunctionlibrary_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 callersMethodreset
Reset camera to default position and zoom.
crates/drafftink-core/src/camera.rs:92
↓ 7 callersMethodrotation
Get the rotation angle in radians (0 for shapes that don't support rotation).
crates/drafftink-core/src/shapes/mod.rs:508
↓ 7 callersMethodsave
Force save the document immediately.
crates/drafftink-core/src/storage/autosave.rs:101
↓ 7 callersMethodsmall
Small circular swatch (default)
crates/drafftink-widgets/src/colors.rs:492
↓ 7 callersMethodto_json
Serialize the document to JSON.
crates/drafftink-core/src/canvas.rs:254
↓ 7 callersMethodto_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 callersMethodadd_shape
Add a shape, syncing to CRDT if enabled.
crates/drafftink-core/src/collaboration.rs:140
↓ 6 callersMethodbegin
Begin a tool interaction.
crates/drafftink-core/src/tools/mod.rs:133
↓ 6 callersMethodbuild_scene
(&mut self, ctx: &RenderContext)
crates/drafftink-render/src/vello_impl.rs:1629
↓ 6 callersMethodcancel
Cancel any ongoing operation.
crates/drafftink-app/src/event_handler.rs:199
↓ 6 callersFunctioncentered_text
Create a centered text shape whose bounding box is centered on `center`.
crates/drafftink-core/src/mermaid/mod.rs:234
↓ 6 callersMethodpan
Pan the camera by a delta in screen coordinates.
crates/drafftink-core/src/camera.rs:68
↓ 6 callersFunctionpanel_frame
Common panel frame style - uses drafftink_widgets.
crates/drafftink-app/src/ui.rs:2474
↓ 6 callersFunctionplace_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 callersFunctionrect_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 callersFunctionsave_document
Save document to a JSON file using native file dialog (async, non-blocking).
crates/drafftink-app/src/app.rs:42
↓ 6 callersMethodshapes_map
Get the shapes map.
crates/drafftink-core/src/crdt/schema.rs:59
↓ 6 callersFunctionsnap_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 callersMethodzoom_at
Zoom the camera, keeping the given screen point fixed.
crates/drafftink-core/src/camera.rs:73
↓ 5 callersFunctionblock_on
(f: F)
crates/drafftink-core/src/storage/autosave.rs:197
↓ 5 callersMethodbuild_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 callersMethodbuild_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 callersMethodcontexts_mut
Get mutable references to both font and layout contexts for text editing.
crates/drafftink-render/src/vello_impl.rs:376
↓ 5 callersMethodctrl
(&self)
crates/drafftink-core/src/input.rs:180
↓ 5 callersMethodfit_within
Scale the image to fit within max dimensions while preserving aspect ratio.
crates/drafftink-core/src/shapes/image.rs:158
↓ 5 callersMethodget_db
Get or create the database connection.
crates/drafftink-core/src/storage/indexeddb.rs:21
↓ 5 callersFunctionget_handles
Get the selection handles for a shape.
crates/drafftink-core/src/selection.rs:73
↓ 5 callersFunctionget_string
(map: &LoroMapValue, key: &str)
crates/drafftink-core/src/crdt/convert.rs:98
next →1–100 of 1,090, ranked by callers