summaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2019-08-01 08:02:33 +0100
committerKatolaZ <katolaz@freaknet.org>2019-08-01 08:02:33 +0100
commit47996e708ad2ab7e6a18633576c95e93d08e816a (patch)
tree466d6eebf592833f8f4e301ac60d1cff6769c2bf /draw.c
parent6d34f883ba3ce2474df90432cc4aa387e9093321 (diff)
add crop-to-region in visual mode
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/draw.c b/draw.c
index 1e73719..ec44c2f 100644
--- a/draw.c
+++ b/draw.c
@@ -331,6 +331,13 @@ void visual_box(FILE *fc){
modified = 1;
goto vis_exit;
break;
+ case 'C':/* crop-to-region */
+ copy_lines_to_ring(0, HEIGHT-1, PRV_STATE);
+ crop_to_rect(MIN(x, orig_x), MIN(y, orig_y), MAX(x, orig_x), MAX(y, orig_y));
+ copy_lines_to_ring(0, HEIGHT-1, NEW_STATE);
+ modified = 1;
+ goto vis_exit;
+ break;
}
check_bound();
set_video(VIDEO_NRM);