Skip to content

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 <lhdjply@126.com>
Signed-off-by: lhdjply <lhdjply@126.com>
@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 <lhdjply@126.com>
@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
@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 <lhdjply@126.com>
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 <lhdjply@126.com>
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