From aef8161c82089dbf015f61db8b8885b03b974328 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 30 Jan 2024 00:11:56 +0100 Subject: [PATCH] [consider merging] cross-hair cursor should not use selection default line width and styles (halo etc.) --- src/laybasic/laybasic/layMouseTracker.cc | 23 +++++++++++++++-------- src/layui/layui/LayoutViewConfigPage2d.ui | 6 ------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/laybasic/laybasic/layMouseTracker.cc b/src/laybasic/laybasic/layMouseTracker.cc index 4de45d0f3..3c531e29b 100644 --- a/src/laybasic/laybasic/layMouseTracker.cc +++ b/src/laybasic/laybasic/layMouseTracker.cc @@ -105,15 +105,22 @@ MouseTracker::mouse_move_event (const db::DPoint &p, unsigned int /*buttons*/, b double max_coord = 1e30; // big enough I guess - mp_markers.push_back (new lay::DMarker (mp_view)); - mp_markers.back ()->set_line_style (m_cursor_line_style); - mp_markers.back ()->set_color (m_cursor_color); - mp_markers.back ()->set (db::DEdge (db::DPoint (tp.x (), -max_coord), db::DPoint (tp.x (), max_coord))); + for (int i = 0; i < 2; ++i) { - mp_markers.push_back (new lay::DMarker (mp_view)); - mp_markers.back ()->set_line_style (m_cursor_line_style); - mp_markers.back ()->set_color (m_cursor_color); - mp_markers.back ()->set (db::DEdge (db::DPoint (-max_coord, tp.y ()), db::DPoint (max_coord, tp.y ()))); + mp_markers.push_back (new lay::DMarker (mp_view)); + mp_markers.back ()->set_line_style (m_cursor_line_style); + mp_markers.back ()->set_line_width (1); + mp_markers.back ()->set_halo (false); + mp_markers.back ()->set_dither_pattern (1); + mp_markers.back ()->set_color (m_cursor_color.is_valid () ? m_cursor_color : mp_view->canvas ()->foreground_color ()); + + if (i == 0) { + mp_markers.back ()->set (db::DEdge (db::DPoint (tp.x (), -max_coord), db::DPoint (tp.x (), max_coord))); + } else { + mp_markers.back ()->set (db::DEdge (db::DPoint (-max_coord, tp.y ()), db::DPoint (max_coord, tp.y ()))); + } + + } } diff --git a/src/layui/layui/LayoutViewConfigPage2d.ui b/src/layui/layui/LayoutViewConfigPage2d.ui index ad779f091..f70f43881 100644 --- a/src/layui/layui/LayoutViewConfigPage2d.ui +++ b/src/layui/layui/LayoutViewConfigPage2d.ui @@ -55,9 +55,6 @@ - - The color in which the rulers are drawn - @@ -151,9 +148,6 @@ - - The color in which the rulers are drawn -