Changeset 1338
- Timestamp:
- 05/06/25 23:03:14 (2 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/canvas/neurodiagram.cpp
r1216 r1338 484 484 { 485 485 clientbordersset = 1; 486 setClientBorder(0, 1, 16, textHeight() + 2); // don't use textheight outside paint/mouse events486 setClientBorder(0, 1, textHeight(), textHeight() + 2); // don't use textheight outside paint/mouse events 487 487 } 488 488 int hold = link->n->flags & Neuro::HoldState; … … 531 531 if (chsel >= 0) 532 532 { 533 int th = textHeight(); 533 534 if (ni) state = (float)ni->getState(chsel); 534 yline -= t extHeight();535 yline -= th; 535 536 int y = mapClientY(neurochart.mapData(state)); 536 int x = size.x - 15- 1;537 int x = size.x - th - 1; 537 538 drawLine(1, yline, size.x - 2, yline); 538 539 if (hold) 539 540 { 540 541 sprintf(t, "hold: %1.3g", state); 541 fillRect(x, y - 1 - 5, 15, 3 + 5 + 5);542 fillRect(x, y - 1 - th/2, th, 3 + th); 542 543 setColor(255, 0, 0); 543 fillRect(x + 2, y - 1, 15 - 2 - 2, 3);544 fillRect(x + 1 + th/8, y - 1 - th/8, th - th/4 - 2, th/4); 544 545 } 545 546 else 546 547 { 547 548 sprintf(t, "signal: %1.3g", state); 548 fillRect(x, y - 1 , 15, 3);549 } 550 drawAlignedText(size.x - t extHeight(), yline, 1, t);549 fillRect(x, y - 1 - th/8, th, th/4 + 1); 550 } 551 drawAlignedText(size.x - th, yline, 1, t); 551 552 } 552 553 … … 625 626 if (b & LeftButton) 626 627 { 627 if (x > size.x - 16) 628 int th = textHeight(); 629 if (x > size.x - th) 628 630 { 629 631 link->n->flags |= Neuro::HoldState; … … 633 635 return LeftButton; 634 636 } 635 else if (y > size.y - 16)637 else if (y > size.y - th) 636 638 { 637 639 link->n->flags ^= Neuro::HoldState; … … 646 648 SString NeuroProbe::hint(int x, int y) 647 649 { 648 if ((chsel >= 0) && (x < size.x - 16) && (y > size.y - 16)) 650 int th = textHeight(); 651 if ((chsel >= 0) && (x < size.x - th) && (y > size.y - th)) 649 652 return SString((link->n->flags & Neuro::HoldState) ? "Click to release" : "Click to hold"); 650 653 else if (insideChSelector(x, y))
Note: See TracChangeset
for help on using the changeset viewer.