Skip to content

Commit

Permalink
Add View::DrawObliqueLine method [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Jun 4, 2024
1 parent 1704223 commit f99f6a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/vrv/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ class View {
void DrawVerticalLine(DeviceContext *dc, int y1, int y2, int x1, int width, int dashLength = 0, int gapLength = 0);
void DrawHorizontalLine(
DeviceContext *dc, int x1, int x2, int y1, int width, int dashLength = 0, int gapLength = 0);
void DrawObliqueLine(
DeviceContext *dc, int x1, int x2, int y1, int y2, int width, int dashLength = 0, int gapLength = 0);
void DrawVerticalSegmentedLine(
DeviceContext *dc, int x1, SegmentedLine &line, int width, int dashLength = 0, int gapLength = 0);
void DrawHorizontalSegmentedLine(
Expand Down
14 changes: 14 additions & 0 deletions src/view_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ void View::DrawHorizontalLine(DeviceContext *dc, int x1, int x2, int y1, int wid
return;
}

void View::DrawObliqueLine(DeviceContext *dc, int x1, int x2, int y1, int y2, int width, int dashLength, int gapLength)
{
assert(dc);

dc->SetPen(m_currentColor, std::max(1, ToDeviceContextX(width)), AxSOLID, dashLength, gapLength);
dc->SetBrush(m_currentColor, AxSOLID);

dc->DrawLine(ToDeviceContextX(x1), ToDeviceContextY(y1), ToDeviceContextX(x2), ToDeviceContextY(y2));

dc->ResetPen();
dc->ResetBrush();
return;
}

void View::DrawVerticalSegmentedLine(
DeviceContext *dc, int x1, SegmentedLine &line, int width, int dashLength, int gapLength)
{
Expand Down

0 comments on commit f99f6a0

Please sign in to comment.