Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-27 18:01:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-27 18:01:16 +0400
commit28a2eedce6ba454021d4caaddccb16424d4774d3 (patch)
tree3b167e59b2ce654bc6952e4df5dae970ba5d7abc /source/blender/editors/space_console/console_ops.c
parent8bc0cfc1ca988749365009eb01ac90dfec2baa50 (diff)
console now stores selection internally with 0 index starting at the end of the line. makes internal logic much less confusing. no functional changes.
Diffstat (limited to 'source/blender/editors/space_console/console_ops.c')
-rw-r--r--source/blender/editors/space_console/console_ops.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 9a53531ba73..802e3a75929 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -695,29 +695,9 @@ static int copy_exec(bContext *C, wmOperator *op)
sel[1]= offset - sc->sel_start;
for(cl= sc->scrollback.first; cl; cl= cl->next) {
-
- int sta= MAX2(0, sel[0]);
- int end= MIN2(cl->len, sel[1]);
-
if(sel[0] <= cl->len && sel[1] >= 0) {
- int str_len= cl->len;
-
- /* highly confusing but draws correctly */
- if(sel[0] < 0 || sel[1] > str_len) {
- if(sel[0] > 0) {
- end= sta;
- sta= 0;
- }
- if (sel[1] <= str_len) {
- sta= end;
- end= str_len;
- }
- }
- /* end confusement */
-
- SWAP(int, sta, end);
- end= cl->len - end;
- sta= cl->len - sta;
+ int sta= MAX2(sel[0], 0);
+ int end= MIN2(sel[1], cl->len);
if(BLI_dynstr_get_len(buf_dyn))
BLI_dynstr_append(buf_dyn, "\n");