Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw component port as filled square when it has only one connection #820

Merged

Conversation

wawuwo
Copy link
Contributor

@wawuwo wawuwo commented Jul 7, 2024

This is a fix of regression introduced in 4e9e968.

When I was adapting the Node::paint to QPainter I made a mistake in translation from couple of braceless ifs to if blocks with braces. Compare this:

    case 2:  if(Connections.getFirst()->Type == isWire)
               if(Connections.getLast()->Type == isWire) return;
             p->fillRect(cx-2, cy-2, 4, 4, Qt::darkBlue);
             break;

and this

    case 2:
      if (Connections.getFirst()->Type == isWire) {
        if (Connections.getLast()->Type == isWire) {
          painter->restore();
          return;
        }
        painter->fillRect(cx-2, cy-2, 4, 4, Qt::darkBlue);
      }
      break;

— the former is logical AND of two conditions, and the latter is something else.

The problem with component port rendering is described in #818

This is a fix of regression introduced in 4e9e968, the problem
is described in ra3xdh#818
@ra3xdh ra3xdh merged commit 002352b into ra3xdh:current Jul 8, 2024
6 checks passed
@ra3xdh ra3xdh linked an issue Jul 8, 2024 that may be closed by this pull request
4 tasks
@wawuwo wawuwo deleted the fix-component-port-single-connection-rendering branch July 26, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dark theme and rendering issue on windows
2 participants