Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Drawing Layer: Backend Implementation #1165

Open
danielsteinkogler opened this issue Jan 18, 2024 · 2 comments
Open

Drawing Layer: Backend Implementation #1165

danielsteinkogler opened this issue Jan 18, 2024 · 2 comments
Assignees
Labels
backend changes in Rust code

Comments

@danielsteinkogler
Copy link
Contributor

danielsteinkogler commented Jan 18, 2024

The drawing layer provides multiple shapes/elements that have to stored in database:

shapes:

  • ellipses
  • rectangles
  • free lines
  • bezier lines
  • polygons

further elements:

  • images

All shapes have following properties in common:

  • id: string;
  • type: //e.g. ellipse, rectangle, ...
  • layerId: number;
  • addDate?: string;
  • removeDate?: string;
  • rotation: number;
  • scaleX: number;
  • scaleY: number;
  • x: number;
  • y: number;
  • color: string;

Properties of rectangle

  • width: number
  • height: number

Properties of ellipses

  • radiusX: number
  • radiusY: number

Properties of free lines

  • strokeWidth: number
  • points

Properties of bezier lines

  • strokeWidth: number
  • points

Properties of polygons

  • strokeWidth: number
  • points
  • fill (has to be defined)

Properties of images

(has to be defined)

Endpoints that are needed

for all shapes:

  • create shape
  • move
  • transform
  • change add date
  • change remove date
  • change color

for lines/polygons

  • change stroke width
  • edit points

Keep in mind: #1168

@danielsteinkogler
Copy link
Contributor Author

@horenso @markus2330, I have created this issue, providing details about the backend implementation for the drawing layer. I have documented all the properties currently used in the frontend. Please feel free to ask questions or start discussions in this comment section. 😊

@markus2330
Copy link
Contributor

Thank you, great work! ❤️

All shapes have following properties in common:

Most important question: Does this include the images? (Can the type be "image"?)

If images are very clumsy to handle in the same layer/endpoint; we actually already had the idea to put images to an extra layer (also for other reasons). Maybe that is the cleaner approach overall?

Are Closed vs. Open polygons/bezier handled via the same endpoints? If yes, we need a boolean to know if they are closed?

Color should be typed, if Typeshare plays well with it, maybe we can use https://docs.rs/image/latest/image/struct.Rgba.html (otherwise we can simply define a struct with 3 or 4 u8, depending on if alpha is needed)

Btw. see also #476, we want creation and modification times/user of every element. For new endpoints we should implement this already. We will discuss this on Monday.

@markus2330 markus2330 moved this to Current Milestone in PermaplanT Jan 22, 2024
@markus2330 markus2330 moved this from Current Milestone to Current Sprint in PermaplanT Jan 29, 2024
@horenso horenso moved this from Current Sprint to In Progress in PermaplanT Feb 28, 2024
@horenso horenso moved this from In Progress to Done in PermaplanT Apr 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend changes in Rust code
Projects
Archived in project
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants