allow locked attached rectangles, so they can not be selected accidentally. Small resize of x/y graph axis labels

This commit is contained in:
stefan schippers 2025-02-22 10:33:13 +01:00
parent a592216c19
commit 0e438829c6
4 changed files with 12 additions and 9 deletions

View File

@ -57,7 +57,8 @@ static int waves_selected(int event, KeySym key, int state, int button)
lmargin = lmargin < 3. ? 3. : lmargin;
lmargin = lmargin > 20. ? 20. : lmargin;
if(!(r->flags & 1) ) continue;
if(!strboolcmp(get_tok_value(xctx->rect[GRIDLAYER][i].prop_ptr, "lock", 0), "true")) continue;
if( !graph_use_ctrl_key && !(state & ControlMask) &&
!strboolcmp(get_tok_value(xctx->rect[GRIDLAYER][i].prop_ptr, "lock", 0), "true")) continue;
check =
(xctx->ui_state & GRAPHPAN) ||
@ -2394,7 +2395,7 @@ void unselect_attached_floaters(void)
for(i = 0; i < xctx->rects[c]; i++) {
if(get_tok_value(xctx->rect[c][i].prop_ptr, "name", 0)[0]) {
found = 1;
select_box(c, i, 0, 1, 0);
select_box(c, i, 0, 1, 1);
}
}
for(i = 0; i < xctx->lines[c]; i++) {

View File

@ -3082,14 +3082,15 @@ void setup_graph_data(int i, int skip, Graph_ctx *gr)
/* x axis, y axis text sizes */
gr->txtsizey = gr->h / gr->divy * 0.0095;
tmp = gr->marginx * 0.003;
if(tmp < gr->txtsizey) gr->txtsizey = tmp;
tmp = gr->marginy * 0.02;
tmp = gr->marginx * 0.004;
if(tmp < gr->txtsizey) gr->txtsizey = tmp;
/* tmp = gr->marginy * 0.02;
* if(tmp < gr->txtsizey) gr->txtsizey = tmp;
*/
gr->txtsizey *= gr->magy;
gr->txtsizex = gr->w / gr->divx * 0.0040;
tmp = gr->marginy * 0.0075;
gr->txtsizex = gr->w / gr->divx * 0.0070;
tmp = gr->marginy * 0.0065;
if(tmp < gr->txtsizex) gr->txtsizex = tmp;
gr->txtsizex *= gr->magx;

View File

@ -953,7 +953,7 @@ static int select_attached_items(int inst, const char *name)
for(i = 0; i < xctx->rects[c]; i++) {
if(!strcmp(name, get_tok_value(xctx->rect[c][i].prop_ptr, "name", 0))) {
found = 1;
select_box(c, i, SELECTED, 1, 0);
select_box(c, i, SELECTED, 1, 1);
}
}
for(i = 0; i < xctx->lines[c]; i++) {

View File

@ -217,7 +217,8 @@ autoload=0
sim_type=tran
xrawfile=$netlist_dir/solar_panel.raw
linewidth_mult=0.4}
linewidth_mult=0.4
lock=1}
B 18 65 -960 320 -775 {}
A 5 320 -960 5.590169943749475 243.434948822922 360 {fill=true}
P 7 6 395 -775 340 -931.25 335 -945 322.5 -960 310 -965 65 -975 {}