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

fix(draw_line): fix the issue where dash_dap equals 1 and cannot display properly when the line is a horizontal line #5473

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

lhdjply
Copy link
Contributor

@lhdjply lhdjply commented Jan 25, 2024

Description of the feature or fix

fix #5029
fix(draw_line): fix the issue where dash_dap equals 1 and cannot display properly when the line is a horizontal line

test code:

void lv_line_dash_dap_test(void)
{
  static lv_point_precise_t line_points[2] = { {50, 50}, {250, 50} };

  lv_obj_t * line1;
  line1 = lv_line_create(lv_screen_active());
  lv_line_set_points(line1, line_points, 2);
  lv_obj_set_style_line_width(line1, 1, LV_PART_MAIN);
  lv_obj_set_style_line_dash_width(line1, 1, LV_PART_MAIN);
  lv_obj_set_style_line_dash_gap(line1, 1, LV_PART_MAIN);
}

before fix

image

after fix

image

Notes

…lay properly when the line is a horizontal line

Signed-off-by: lhdjply <[email protected]>
Signed-off-by: lhdjply <[email protected]>
@kisvegabor
Copy link
Member

Very nice, thank you!

Could you add a test with various dash configurations on horizontal and vertical lines too?

Signed-off-by: lhdjply <[email protected]>
@lhdjply
Copy link
Contributor Author

lhdjply commented Jan 25, 2024

Done

Copy link
Contributor

@W-Mai W-Mai left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@kisvegabor kisvegabor merged commit e05e1f3 into lvgl:master Jan 25, 2024
16 checks passed
@lhdjply lhdjply deleted the fix_dash_gap_hor branch January 26, 2024 00:04
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
…lay properly when the line is a horizontal line (lvgl#5473)

Signed-off-by: lhdjply <[email protected]>
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
…lay properly when the line is a horizontal line (lvgl#5473)

Signed-off-by: lhdjply <[email protected]>
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.

Dash width and gap are rendered incorrectly on horizontal lines.
3 participants