Handling of guiding shape layers - prevent the properties dialogs from changing it

This commit is contained in:
Matthias Koefferlein 2025-12-01 18:26:22 +01:00
parent 4b6cd3f6f5
commit 78b62e13d1
3 changed files with 20 additions and 3 deletions

View File

@ -129,12 +129,17 @@ ChangeLayerApplicator::ChangeLayerApplicator (unsigned int cv_index, unsigned in
db::Shape ChangeLayerApplicator::do_apply (db::Shapes & /*shapes*/, const db::Shape &shape, double /*dbu*/, unsigned int cv_index, unsigned int layer, bool /*relative*/) const db::Shape ChangeLayerApplicator::do_apply (db::Shapes & /*shapes*/, const db::Shape &shape, double /*dbu*/, unsigned int cv_index, unsigned int layer, bool /*relative*/) const
{ {
db::Shape s = shape; db::Shape s = shape;
if (m_cv_index == cv_index && layer != m_new_layer) { if (m_cv_index == cv_index && layer != m_new_layer && m_skipped_layers.find (layer) == m_skipped_layers.end ()) {
s.set_layer (m_new_layer); s.set_layer (m_new_layer);
} }
return s; return s;
} }
void ChangeLayerApplicator::skip_layer (unsigned int l)
{
m_skipped_layers.insert (l);
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// BoxDimensionsChangeApplicator implementation // BoxDimensionsChangeApplicator implementation

View File

@ -125,9 +125,11 @@ public:
bool supports_relative_mode () const { return false; } bool supports_relative_mode () const { return false; }
db::Shape do_apply (db::Shapes &shapes, const db::Shape &shape, double dbu, unsigned int cv_index, unsigned int layer, bool relative) const; db::Shape do_apply (db::Shapes &shapes, const db::Shape &shape, double dbu, unsigned int cv_index, unsigned int layer, bool relative) const;
void skip_layer (unsigned int l);
private: private:
unsigned int m_cv_index, m_new_layer; unsigned int m_cv_index, m_new_layer;
std::set<unsigned int> m_skipped_layers;
}; };
/** /**

View File

@ -281,7 +281,10 @@ ShapePropertiesPage::do_apply (bool current_only, bool relative, bool commit)
int new_layer = layer_selector ()->current_layer (); int new_layer = layer_selector ()->current_layer ();
if (new_layer >= 0 && int (pos->layer ()) != new_layer) { if (new_layer >= 0 && int (pos->layer ()) != new_layer) {
applicator.reset (new CombinedChangeApplicator (applicator.release (), new ChangeLayerApplicator (cv_index, (unsigned int) new_layer))); unsigned int gs_layer = cv->layout ().guiding_shape_layer ();
ChangeLayerApplicator *cla = new ChangeLayerApplicator (cv_index, (unsigned int) new_layer);
cla->skip_layer (gs_layer);
applicator.reset (new CombinedChangeApplicator (applicator.release (), cla));
} }
} }
@ -425,10 +428,17 @@ ShapePropertiesPage::update_shape ()
const lay::CellView &cv = view ()->cellview (pos->cv_index ()); const lay::CellView &cv = view ()->cellview (pos->cv_index ());
double dbu = cv->layout ().dbu (); double dbu = cv->layout ().dbu ();
unsigned int gs_layer = cv->layout ().guiding_shape_layer ();
m_enable_cb_callback = false; m_enable_cb_callback = false;
layer_selector ()->set_view (view (), pos->cv_index (), true); layer_selector ()->set_view (view (), pos->cv_index (), true);
layer_selector ()->set_current_layer (pos->layer ()); if (pos->layer () == gs_layer) {
layer_selector ()->setEnabled (false);
layer_selector ()->set_current_layer (-1);
} else {
layer_selector ()->setEnabled (true);
layer_selector ()->set_current_layer (pos->layer ());
}
m_enable_cb_callback = true; m_enable_cb_callback = true;
std::string cell_str; std::string cell_str;