Python console: cursor drawing issue #74298

Closed
opened 2020-02-28 16:33:19 +01:00 by Kim Geonwoo · 7 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.19

Blender Version
Broken: version: 2.83 (sub 5), branch: master, commit date: 2020-02-28 13:46, hash: 94dcfe7a77

Short description of error
Cursor is drawn higher every time current line go up, and gone when text reach the top of main window.
Desktop 2020.02.28 - 23.50.47.03 (online-video-cutter.com).mp4

Exact steps for others to reproduce the error
On the default startup, open python console.

  1. Make a number of lines by typing some text or zooming in, and make cursor go up using arrow key.
  2. Type more text or zoom in until text reach the top of main window.
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.19 **Blender Version** Broken: version: 2.83 (sub 5), branch: master, commit date: 2020-02-28 13:46, hash: `94dcfe7a77` **Short description of error** Cursor is drawn higher every time current line go up, and gone when text reach the top of main window. [Desktop 2020.02.28 - 23.50.47.03 (online-video-cutter.com).mp4](https://archive.blender.org/developer/F8378219/Desktop_2020.02.28_-_23.50.47.03__online-video-cutter.com_.mp4) **Exact steps for others to reproduce the error** On the default startup, open python console. 1. Make a number of lines by typing some text or zooming in, and make cursor go up using arrow key. 2. Type more text or zoom in until text reach the top of main window.
Author

Added subscriber: @skyjib

Added subscriber: @skyjib

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author

I found out the reason why cursor has gone.

      if (!textview_draw_string(&tds,
                                ext_line,
                                ext_len,
                                (data_flag & TVC_LINE_FG) ? fg : NULL,
                                (data_flag & TVC_LINE_BG) ? bg : NULL,
                                (data_flag & TVC_LINE_ICON) ? icon : 0,
                                (data_flag & TVC_LINE_ICON_FG) ? icon_fg : NULL,
                                (data_flag & TVC_LINE_ICON_BG) ? icon_bg : NULL,
                                bg_sel)) {
        /* When drawing, if we pass v2d->cur.ymax, then quit. */
        if (do_draw) {
          /* Past the y limits. */
          break;
        }
      }

      if (do_draw) {
        if (tvc->draw_cursor && iter_index == 0) {
          tvc->draw_cursor(tvc, tds.cwidth, tds.columns, tds.lofs);
        }
      }

textview_draw_string returns false when the last line is off the screen, then it breaks the loop that calls draw_cursor.
When break is removed or draw_cursor is called before break, cursor will be drawn incorrectly without disappearing.
SharedScreenshot.jpg

I found out the reason why cursor has gone. ``` if (!textview_draw_string(&tds, ext_line, ext_len, (data_flag & TVC_LINE_FG) ? fg : NULL, (data_flag & TVC_LINE_BG) ? bg : NULL, (data_flag & TVC_LINE_ICON) ? icon : 0, (data_flag & TVC_LINE_ICON_FG) ? icon_fg : NULL, (data_flag & TVC_LINE_ICON_BG) ? icon_bg : NULL, bg_sel)) { /* When drawing, if we pass v2d->cur.ymax, then quit. */ if (do_draw) { /* Past the y limits. */ break; } } if (do_draw) { if (tvc->draw_cursor && iter_index == 0) { tvc->draw_cursor(tvc, tds.cwidth, tds.columns, tds.lofs); } } ``` `textview_draw_string` returns false when the last line is off the screen, then it breaks the loop that calls `draw_cursor`. When break is removed or `draw_cursor` is called before break, cursor will be drawn incorrectly without disappearing. ![SharedScreenshot.jpg](https://archive.blender.org/developer/F8388052/SharedScreenshot.jpg)

Added subscriber: @brezdo

Added subscriber: @brezdo

Removed subscriber: @brezdo

Removed subscriber: @brezdo

This issue was referenced by db6e267bfc

This issue was referenced by db6e267bfc73767446515be3f802065abbf633e8

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Campbell Barton self-assigned this 2020-05-20 10:17:18 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#74298
No description provided.