Skip to content

Use MAP_SYMBOL_PEN_SCALE instead of MAP_STROKE_WIDTH#7822

Merged
remkos merged 3 commits intomasterfrom
Default-rename
Sep 20, 2023
Merged

Use MAP_SYMBOL_PEN_SCALE instead of MAP_STROKE_WIDTH#7822
remkos merged 3 commits intomasterfrom
Default-rename

Conversation

@PaulWessel
Copy link
Member

@PaulWessel PaulWessel commented Sep 20, 2023

See #7788 for discussion at end. Note the internal variable is map_stroke_width. Two questions:

  1. Rename map_stroke_width to map_stroke_factor
  2. Consider SCALE instead of FACTOR?

Not sure what is best but will go with the flow of comments. Closes #7788.

See #7788 for discussion at end.  Note the internal variable is map_stroke_width. wo questions:

1. Rename map_stroke_width to map_stroke_factor
2. Consider SCALE instead of FACTOR?
@PaulWessel PaulWessel added the documentation Improve documentation label Sep 20, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Sep 20, 2023
@PaulWessel PaulWessel self-assigned this Sep 20, 2023
@remkos
Copy link
Contributor

remkos commented Sep 20, 2023

I'm fine with FACTOR.

@joa-quim
Copy link
Member

Can we drop the STROKE? The variable name is very long and will look ugly if used in command with the -- mechanism. And many may think the symbol had and hart attack 😄

@PaulWessel
Copy link
Member Author

Can we drop the STROKE? The variable name is very long and will look ugly if used in command with the -- mechanism. And many may think the symbol had and hart attack 😄

It surely is long, give you that. @remkos used to be the master of brevity. Anything shorter, Remko?

@remkos
Copy link
Contributor

remkos commented Sep 20, 2023

Can we drop the STROKE? The variable name is very long and will look ugly if used in command with the -- mechanism. And many may think the symbol had and hart attack 😄

It's true that this would be getting long. But MAP_SYMBOL_FACTOR is not very clear, is it? It would suggest some dependent scaling of the whole symbol. If you want to avoid STROKE, it ought probably be MAP_SYMBOL_PEN_FACTOR.
But in that case, I start to feel with @PaulWessel that it should be MAP_SYMBOL_PEN_SCALE.

Look @joa-quim : I just saved 3 characters 😄. It is shorter than many of the others that we have, e.g.: MAP_GRID_CROSS_SIZE_SECONDARY

@joa-quim
Copy link
Member

I prefer MAP_SYMBOL_PEN_SCALE to MAP_SYMBOL_PEN_FACTOR, and I definitely prefer PEN to STROKE and not because it's 3 chars shorter but because the meaning is much more clear (no coronaries involved).

@seisman
Copy link
Member

seisman commented Sep 20, 2023

Do we really need the new default MAP_SYMBOL_STROKE_FACTOR? It's easy to change the scale via the -W option so I feel the new default will be rarely used.

@PaulWessel PaulWessel changed the title Use MAP_SYMBOL_STROKE_FACTOR instead of MAP_STROKE_WIDTH WIP Use MAP_SYMBOL_STROKE_FACTOR instead of MAP_STROKE_WIDTH Sep 20, 2023
@remkos
Copy link
Contributor

remkos commented Sep 20, 2023

@seisman : You can set the pen width with -W, but that would then apply to any symbol size. The thing is that Paul wanted to ensure that if someone did not supply -W, some pen width would be set automatically. For example -Sx30p -Gred should automatically result in -Sx20p -Gred -W3p, assuming a scale factor of 0.15 (15%).

But in any case you are correct: it would be a barely used setting.

@PaulWessel
Copy link
Member Author

I aded WIP until we have a solution. Just so we are on the same page. Unless MAP_SYMBOL_STROKE_FACTOR is set to 0, we do

GMT->current.setting.map_stroke_width * S.size_x * PSL_POINTS_PER_INCH

So the pen thickness does not enter I think, @seisman ? The whole point was to scale the pen to a fraction of symbol size. Adding -W4p makes all symbols fat.

@seisman
Copy link
Member

seisman commented Sep 20, 2023

The whole point was to scale the pen to a fraction of symbol size. Adding -W4p makes all symbols fat.

That makes sense to me now.

If you want to avoid STROKE, it ought probably be MAP_SYMBOL_PEN_FACTOR

My first impression about MAP_SYMBOL_PEN_FACTOR is that it is applied to all symbols like circles.

@PaulWessel
Copy link
Member Author

Must say MAP_SYMBOL_PEN_SCALE is not bad: Avoids cardiac arrests and shaves a few letters.

@PaulWessel
Copy link
Member Author

My first impression about MAP_SYMBOL_PEN_FACTOR is that it is applied to all symbols like circles.

Well, I think this obscure default [15%] wont confuse people if they read the documentation about it and why it is there. I have a linear size -> pen thickness scheme but am I convinced there will be some users who thinks the 15% is too big or too small. Those guys can use the setting rather than "it cannot be done". The docs list the four symbols that this default pertains to: x, y, +, -.

@remkos
Copy link
Contributor

remkos commented Sep 20, 2023

I agree: RTFM.

@PaulWessel PaulWessel changed the title WIP Use MAP_SYMBOL_STROKE_FACTOR instead of MAP_STROKE_WIDTH Use MAP_SYMBOL_PEN_SCALE instead of MAP_STROKE_WIDTH Sep 20, 2023
@remkos remkos merged commit a49660f into master Sep 20, 2023
@remkos remkos deleted the Default-rename branch September 20, 2023 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improve documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Treat stroke-symbols as other symbols unless -W is set

4 participants