Diagrams always are full width and pushed to the left; unable to be center or right aligned #4012

Closed
opened 2026-02-05 08:02:57 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @jeremyherbert on GitHub (Aug 28, 2023).

Describe the Bug

No matter how I position my diagram on the canvas, it always has the diagram pushed to the left and the right spacing extended to the maximum:

Edit_Page_Draft___BookStack_Demo

I would like to center my diagram, but this seems impossible.

(note that the light blue rectangle was added by me highlighting the image in my browser to show the empty space)

Steps to Reproduce

  1. Go to demo instance and open a draft/new page
  2. Add a diagram
  3. Add a small shape to the center of the canvas
  4. Save and exit the diagram editor
  5. The image in the editor does not have the shape at the center, and has significant blank space to the right

Expected Behaviour

The PNG generated from the diagram should either be the same size as the canvas, or the minimum size needed to hold the diagram. It shouldn't arbitrarily add maximum whitespace to one side.

Screenshots or Additional Context

(see earlier)

Browser Details

Chrome 116.0.5845.110

Exact BookStack Version

Whatever is on the demo server :)

PHP Version

No response

Hosting Environment

Whatever is on the demo server :)

Originally created by @jeremyherbert on GitHub (Aug 28, 2023). ### Describe the Bug No matter how I position my diagram on the canvas, it always has the diagram pushed to the left and the right spacing extended to the maximum: ![Edit_Page_Draft___BookStack_Demo](https://github.com/BookStackApp/BookStack/assets/52499/a43e88e2-4535-41b5-a86b-2818ee823dce) I would like to center my diagram, but this seems impossible. (note that the light blue rectangle was added by me highlighting the image in my browser to show the empty space) ### Steps to Reproduce 1. Go to demo instance and open a draft/new page 2. Add a diagram 3. Add a small shape to the center of the canvas 4. Save and exit the diagram editor 5. The image in the editor does not have the shape at the center, and has significant blank space to the right ### Expected Behaviour The PNG generated from the diagram should either be the same size as the canvas, or the minimum size needed to hold the diagram. It shouldn't arbitrarily add maximum whitespace to one side. ### Screenshots or Additional Context (see earlier) ### Browser Details Chrome 116.0.5845.110 ### Exact BookStack Version Whatever is on the demo server :) ### PHP Version _No response_ ### Hosting Environment Whatever is on the demo server :)
OVERLORD added the 🐛 Bug label 2026-02-05 08:02:57 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4012