diff --git a/devel/222_54.md b/devel/222_54.md index 143ceccd03..df0ab89910 100644 --- a/devel/222_54.md +++ b/devel/222_54.md @@ -1,15 +1,14 @@ -# [222_54] 增强html的格式检测 +# [222_54]: Changed graphical selection from blue fill to black border(#2963) -## 如何测试 +### What +Changed the Graphical Window selection color to transparent and its instead indicated by a black border -```shell -bin/test_only 222_54 -``` +### Why +Currently, when a user clicks or selects a graphics canvas, the editor applies a semi-transparent blue fill over the entire area. On large canvases or complex drawings, this fill obscures the content and makes it difficult to see the grid or the objects being edited. + +### How +In `src/Edit/Interface/edit_repaint.cpp`: +1. checks if the current selection is inside_active_graphics(). +2. If true, the standard selection fill is bypassed. +3. Implemented a manual 4-line border drawing using ren->line based on the rectangle's bounding coordinates (x1, y1, x2, y2) instead of the filling -## 2026/01/22 增强html的格式检测 -1. < > 含量检测 -2. = " 含量检测 -3. 常见html标签检测 -4. 有html特征的行的检测 -5. div标签的平衡性检测 -6. 短文本检测 diff --git a/src/Edit/Interface/edit_repaint.cpp b/src/Edit/Interface/edit_repaint.cpp index 1f2e914fa0..1c281e9f9d 100644 --- a/src/Edit/Interface/edit_repaint.cpp +++ b/src/Edit/Interface/edit_repaint.cpp @@ -65,13 +65,27 @@ edit_interface_rep::draw_env (renderer ren) { ren->draw_rectangles (env_rects); } if (!is_nil (foc_rects)) { - color col= get_env_color (FOCUS_COLOR); - ren->set_pencil (pencil (col, ren->pixel)); + if (inside_active_graphics ()) { + ren->set_pencil (pencil (black, 2 * ren->pixel)); + rectangles rs = foc_rects; + while (!is_nil (rs)) { + rectangle current = rs->item; + ren->line (current->x1, current->y1, current->x2, current->y1); + ren->line (current->x1, current->y2, current->x2, current->y2); + ren->line (current->x1, current->y1, current->x1, current->y2); + ren->line (current->x2, current->y1, current->x2, current->y2); + rs = rs->next; + } + } + else{ + color col= get_env_color (FOCUS_COLOR); + ren->set_pencil (pencil (col, ren->pixel)); #ifdef QTTEXMACS ren->draw_selection (foc_rects); #else ren->draw_rectangles (foc_rects); #endif + } } if (!is_nil (sem_rects)) { if (sem_correct) { @@ -174,14 +188,28 @@ edit_interface_rep::draw_selection (renderer ren, rectangle r) { #endif } if (!is_nil (selection_rects)) { - color col= get_env_color (SELECTION_COLOR); - if (table_selection) col= get_env_color (TABLE_SELECTION_COLOR); + if (inside_active_graphics ()) { + ren->set_pencil (pencil (black, 2 * ren->pixel)); + rectangles rs = selection_rects & visible; + while (!is_nil (rs)) { + rectangle current = rs->item; + ren->line (current->x1, current->y1, current->x2, current->y1); + ren->line (current->x1, current->y2, current->x2, current->y2); + ren->line (current->x1, current->y1, current->x1, current->y2); + ren->line (current->x2, current->y1, current->x2, current->y2); + rs = rs->next; + } + } + else{ + color col= get_env_color (SELECTION_COLOR); + if (table_selection) col= get_env_color (TABLE_SELECTION_COLOR); ren->set_pencil (pencil (col, ren->pixel)); #ifdef QTTEXMACS ren->draw_selection (selection_rects & visible); #else ren->draw_rectangles (selection_rects & visible); #endif + } } draw_image_resize_handles (ren);