---------------------------------------------------
| 3137 | |
| 3138 | // --------------------------------------------------- |
| 3139 | void Schematic::copyLabels(int& x1, int& y1, int& x2, int& y2, |
| 3140 | QList<Element *> *ElementCache) |
| 3141 | { |
| 3142 | WireLabel *pl; |
| 3143 | // find bounds of all selected wires |
| 3144 | for(Wire *pw = Wires->first(); pw != 0; pw = Wires->next()) |
| 3145 | { |
| 3146 | pl = pw->Label; |
| 3147 | if(pl) if(pl->isSelected) |
| 3148 | { |
| 3149 | if(pl->x1 < x1) x1 = pl->x1; |
| 3150 | if(pl->y1-pl->y2 < y1) y1 = pl->y1-pl->y2; |
| 3151 | if(pl->x1+pl->x2 > x2) x2 = pl->x1+pl->x2; |
| 3152 | if(pl->y1 > y2) y2 = pl->y1; |
| 3153 | ElementCache->append(pl); |
| 3154 | } |
| 3155 | } |
| 3156 | |
| 3157 | for(Node *pn = Nodes->first(); pn != 0; pn = Nodes->next()) |
| 3158 | { |
| 3159 | pl = pn->Label; |
| 3160 | if(pl) if(pl->isSelected) |
| 3161 | { |
| 3162 | if(pl->x1 < x1) x1 = pl->x1; |
| 3163 | if(pl->y1-pl->y2 < y1) y1 = pl->y1-pl->y2; |
| 3164 | if(pl->x1+pl->x2 > x2) x2 = pl->x1+pl->x2; |
| 3165 | if(pl->y1 > y2) y2 = pl->y1; |
| 3166 | ElementCache->append(pl); |
| 3167 | pl->pOwner->Label = 0; // erase connection |
| 3168 | pl->pOwner = 0; |
| 3169 | } |
| 3170 | } |
| 3171 | } |
| 3172 | |
| 3173 | |
| 3174 | /* ******************************************************************* |