Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions devel/222_54.md
Original file line number Diff line number Diff line change
@@ -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. 短文本检测
36 changes: 32 additions & 4 deletions src/Edit/Interface/edit_repaint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down