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

drawing, config, callbacks: add arrowtype option allowing arrow heads… #195

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

pascal-niklaus
Copy link
Contributor

… at both line ends

Syntax in config file with new option arrowtype, which can take values "->" (default), "<-", or "<->".

Example:

"red Pen" = PEN (size=5 color="red", arrowsize=2, arrowtype="->");
"blue Pen" = PEN (color="cyan", size=2, arrowsize=2 arroytype="<->");
"yellow Pen" = LINE (color="yellow" size=2 arrowsize=2 arrowtype="<-");

Copy link
Owner

@bk138 bk138 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, sorry for the long delay, I got held back by other stuff. Also again, thanks for that nice contribution, I have only some minor change requests.

PS: Don't bother keeping a clean history on the branch, I'll simply squash-merge when ready.

Thanks again!

src/main.h Outdated Show resolved Hide resolved
src/main.c Outdated Show resolved Hide resolved
src/config.c Show resolved Hide resolved
@pascal-niklaus
Copy link
Contributor Author

I updated the PR accordingly, now writing the value in the enum as

  GROMIT_ARROW_DOUBLE = (GROMIT_ARROW_START | GROMIT_ARROW_END )

which should be clear...

@bk138
Copy link
Owner

bk138 commented Mar 8, 2024

I updated the PR accordingly, now writing the value in the enum as

  GROMIT_ARROW_DOUBLE = (GROMIT_ARROW_START | GROMIT_ARROW_END )

which should be clear...

Yeah this is even more clear, thanks!

@bk138
Copy link
Owner

bk138 commented Mar 8, 2024

One more thing: I noticed that the following minimal config

"red Pen" = PEN (size=5 color="red" arrowtype="double" arrowsize=3);
"default" = "red Pen";

does not correctly parse arrowtype.

@pascal-niklaus
Copy link
Contributor Author

One more thing: I noticed that the following minimal config

"red Pen" = PEN (size=5 color="red" arrowtype="double" arrowsize=3);
"default" = "red Pen";

does not correctly parse arrowtype.

Indeed parsing arrowsize did reset the option to arrowtype=="end", so arrowtype only worked as intended after arrowsize.

Also, I removed ARROW_TYPE_NONE because it was redundant with arrowsize==0. Anyway, arrowsize==0 acts as flag whether there are arrows, and only then is the arrow type tested.

@bk138 bk138 merged commit aa1c807 into bk138:master Mar 11, 2024
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.

2 participants