Skip to content

grdsample: Fix the incorrect handling of -Am and -Ap - #8667

Merged
remkos merged 2 commits into
masterfrom
grdsample/-A
Jan 4, 2025
Merged

remkos merged 2 commits into
masterfrom
grdsample/-A

Conversation

@seisman

@seisman seisman commented Jan 4, 2025

Copy link
Copy Markdown
Member

See #8645 (comment) for context.

This PR fixes the sample1d -Am|-Ap issue.

Comment thread src/gmt_vector.c

for (i = 1; i < n; i++) {
if (mode == GMT_STAIRS_Y) { /* First follow x, then y */
if (mode == GMT_STAIRS_X) { /* First follow x, then y */

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This if-statement should check mode == GMT_STAIR_X, because at lines 455, the y values are constant and the x values are changing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, and with GMT_STAIRS_Y = 1, GMT_STAIRS_X = 2, that matches now all the comments.
As a matter of fact, I met this issue once, but thought I had made a user error.

@seisman
seisman requested a review from a team January 4, 2025 13:11
@seisman seisman added the bug Something isn't working label Jan 4, 2025
@seisman seisman added this to the 6.6.0 milestone Jan 4, 2025
@github-actions

github-actions Bot commented Jan 4, 2025

Copy link
Copy Markdown
Contributor

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
modified test/baseline/sample1d/
modified test/baseline/sample1d/sample.ps

Image diff(s)

Details

Added images

Modified images

Path Old New
test/baseline/sample1d/sample.ps

Report last updated at commit 8a57876

Comment thread src/gmt_vector.c

for (i = 1; i < n; i++) {
if (mode == GMT_STAIRS_Y) { /* First follow x, then y */
if (mode == GMT_STAIRS_X) { /* First follow x, then y */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, and with GMT_STAIRS_Y = 1, GMT_STAIRS_X = 2, that matches now all the comments.
As a matter of fact, I met this issue once, but thought I had made a user error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants