Transformed selected instances lose selection status

Đang mở
#2,150 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp, python
Lĩnh vực
desktop

Hướng nghiên cứu

Start with the provided Python script and the Plugin mouse-click event handler described in the issue; compare the selection behavior when transforming an instance with the behavior when the transform call is replaced by pass. The issue says the script did not reproduce the problem in isolation, so check it in the menu-command context described. Done means a transformed instance remains selected in that context.

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

Mô tả

Steps to reproduce

  1. create layout with 1 instance and 1 shape
  2. test shape
    1. select shape
    2. call the script
    3. OBTAINED: shape was moved
    4. OBTAINED: shape stays selected, GOOD
  3. test instance
    1. select instance
    2. call the script
    3. OBTAINED: instance was moved
    4. EXPECTED: instance stays selected
    5. OBTAINED: instance no longer selected

EDIT: Hmmm ... can't reproduce it in isolation with the script below.
Is it possible that it behaves differently when it's called from a menu command again?

# Issue: https://github.com/KLayout/klayout/issues/2150

import pya
lv = pya.LayoutView.current()

trans = pya.DTrans(0.5, 0.5)

for o in lv.each_object_selected():
    if o.shape is not None:
        o.shape.transform(trans)
    else:
        inst = o.path[0].inst()
        inst.transform(trans)

In my setup, basically

  • my Plugin reacts on mouse click event to commit a move operation
  • then the above code is executed from the event handler
  • if i replace the inst.transform(trans) with pass, the selection is retained
Ngôn ngữ chính
C++
Star
1.2k
Fork
305
Merge trung bình
3 ngày 2 giờ
Pull request đã merge (30 ngày)
11

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 KLayout/klayout

Tất cả issue của KLayout/klayout

Issue tương tự

Thêm issue về C++

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.