Objects snapped to grid do not have integer mm sizes or positions

Đang mở
#604 4 bình luận 6 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Start by reproducing the steps in the Windows app with diagram units set to mm and grid size 10, then inspect the code that handles grid snapping and unit conversion. The issue does not name files or tests, so locate the relevant entry points from the reproduction. Done means a rectangle snapped to one major grid square reports 10 mm × 10 mm and integer positions in the Arrange tab.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

notstale

Hi,

When working in mm, objects snapped to grid boundaries do not have integer mm sizes or positions.

Steps to reproduce:

  1. Create new diagram
  2. Set the diagram units to be mm
  3. Set the grid to 10 (there's no unit here, so presumably it matches the diagram's unit type?)
  4. Drop a rectangle onto the page
  5. Resize the rectangle using the mouse to fit it into one "Major gridline square"
  6. Look at the size of the rectangle in the "Arrange" tab

Expected:

  • The rectangle's size is 10 mm × 10 mm
  • The rectangle's position is an integer

Actual:

  • The rectangle's size is 10.2 mm × 10.2 mm
  • The rectangle's position is not an integer

Could it be that the grid is still in points despite the page being in mm?

This was seen in the latest version of the Windows app (v12.1.0)

Screenshot below, with peculiar size and position highlighted in yellow:

image

Ngôn ngữ chính
JavaScript
Star
9.4k
Fork
1.4k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jgraph/drawio

Tất cả issue của jgraph/drawio

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.