Commit Graph

20 Commits

Author SHA1 Message Date
1ilit
b9da7e618f load diagram in read only mode from previous version 2025-08-24 18:39:35 +04:00
Karen Mkrtumyan
b62471c03f Add ctrl select support (#527)
* Add ctrl select support

* fix the issue with clicking on overlapping objects

* simplify the code, add meta to ctrl for macos

* fix lock unlock with command on macos
2025-08-09 13:22:04 +04:00
1ilit
0e196de261 Fix handleColorChange when no redo action is recorded (#538) 2025-07-23 22:23:51 +04:00
Karen Mkrtumyan
a5718f8359 Refactor dragging logic (#523)
* refactor dragging logic

* Remove unnecessary undefined in TableInfo.jsx
2025-07-05 22:37:58 +04:00
Karen Mkrtumyan
e609003b25 Change move to batch move only (#508)
* add notDragging constant

* change move to only bulk move
2025-07-01 17:49:35 +04:00
Karen Mkrtumyan
5a5304073e Add onDoubleClick for notes and areas as edit (#503) 2025-06-23 00:26:44 +04:00
Karen Mkrtumyan
e56f6409ff Fix ColorPicker undo stack additions (#494)
* Fix ColorPicker undo stack additions

* make custom component ColorPicker
2025-06-20 18:18:06 +04:00
1ilit
938ad7c01d Lock notes and subject areas (#480) 2025-06-07 22:24:01 +04:00
1ilit
0efb5470ab Bulk select (#395)
* add rect for select

* collect selected elements

* increase note stroke width

* move elements and undo redo

* add icon to toolbar to toggle multiselect mode

* set bulk selected elements to none when panning
2025-04-09 01:00:20 +04:00
1ilit
46e91069d5 Replace colorpalette with colorpicker (#392) 2025-04-06 03:36:46 +04:00
1ilit
f95841f0e7 Migrate to tailwind v4 (#370) 2025-03-21 01:25:36 +04:00
Felix Zedén Yverås
5a56c3b354 refactor: export CanvasContextProvider to follow established context pattern
As noted [in the review](
https://github.com/drawdb-io/drawdb/pull/148#discussion_r1681584836
), I disagree with this pattern. However, I will follow it to get
these features added.
2024-07-17 22:22:52 +02:00
Felix Zedén Yverås
e4e22dee20 fix: rewrite coordinate management
After some initial smaller fixes, it turned out that I had broken
the red line used when linking fields. Fixing this was not trivial
as I found myself battling a lot of small bugs relating to scale
and translation in the existing code. This was made extra difficult
as a lot of coordinates were calculated when necessary in
Canvas.jsx.

This commit attempts to simplify the coordinate management in a few
different ways:
* There are now two distinct coordinate systems in use, typically
  referred to as "spaces". Screen space and diagram space.
* Diagram space is no longer measured in pixels (though the
  dimension-less measure used instead still maps to pixels at 100%
  zoom).
* The canvas now exposes helper methods for transforming between
  spaces.
* Zoom and translation is now managed via the svg viewBox property.
  * This makes moving items in diagram space much easier as the
    coordinates remain constant regardless of zoom level.
* The canvas now wraps the current mouse position in a context
  object, making mouse movement much easier to work with.
* The transform.pan property now refers to the center of the screen.

A new feature in this commit is that scroll wheel zoom is now based
on the current cursor location, making the diagram more convenient
to move around in.

I have tried to focus on Canvas.jsx and avoid changes that might be
desctructive on existing save files. I also believe more refactors
and abstractions could be introduced based on these changes to make
the diagram even easier to work with. However, I deem that out of
scope for now.
2024-07-17 22:22:52 +02:00
Felix Zedén Yverås
cdecf7c633 feat: add basic touchscreen support
This is basically a migration from mouse events to
[pointer events](
  https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events
).

The `PointerEvent` interface inherits all of the `MouseEvent`
properties, meaning that existing code can essentially be left
as-is. The only major change is making sure we only respond to the
"primary" pointer.

Known issues include:
* stylus hover is not detected
* touchscreens do not have a concept of hover, making it difficult
  to e.g. resize areas
* no touch gesture support, e.g. "pinch-to-zoom"
2024-07-14 15:36:54 +02:00
1ilit
2b4b01c358 Configure i18n and add simplified chinese (#99) 2024-05-16 06:45:47 +03:00
1ilit
9efee285c8 Fix subject area title overflow 2024-04-14 10:28:08 +03:00
haecheonlee
cc32ffdd80 Fix rendering area in safari 2024-04-13 20:30:56 -04:00
1ilit
155810d7e6 Fix typo 2024-04-06 10:27:18 +03:00
1ilit
1efd72dfe3 Use ColorPallete in area popover 2024-04-06 09:56:20 +03:00
1ilit
9df9527950 Reorganize files 2024-04-01 19:44:50 +03:00