Transformed selected instances lose selection status

Aperta
#2,150 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp, python
Ambito
desktop

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
C++
Stelle
1.2k
Fork
305
Merge medio
3g 2h
PR unite (30g)
11

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di KLayout/klayout

Tutte le issue di KLayout/klayout

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.