Opened 6 years ago

Closed 6 years ago

#2081 closed defect (fixed)

Empty (2D) label throws exception

Reported by: Eric Pettersen Owned by: Tom Goddard
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Darwin-18.6.0-x86_64-i386-64bit
ChimeraX Version: 0.91 (2019-06-07)
Description
Creating a 2D label with no text specified (or an empty string specified) produces this error.

Log:
UCSF ChimeraX version: 0.91 (2019-06-07)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 3esu format mmCIF fromDatabase pdb

3esu title:  
Crystal structure of anthrax-neutralizing single-chain antibody 14b7 [more
info...]  
  
Chain information for 3esu #1  
---  
Chain | Description  
F | Antibody 14b7* light chain and antibody 14b7* heavy chain linked with a
synthetic (GGGGS)4 linker  
  
  

> 2dlabels create xy text color red background blue

QPainter::begin: Paint device returned engine == 0, type: 3  

QPainter::setFont: Painter not active  

QPainter::setPen: Painter not active  

An error occurred in drawing the scene. Redrawing graphics is now stopped to
avoid a continuous stream of error messages. To restart graphics use the
command "graphics restart" after changing the settings that caused the error.  
  
Traceback (most recent call last):  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/updateloop.py", line 72, in draw_new_frame  
view.draw(check_for_changes = False)  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/view.py", line 168, in draw  
draw_overlays(self._overlays, r)  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/drawing.py", line 1461, in draw_overlays  
_draw_multiple(drawings, r, Drawing.OPAQUE_DRAW_PASS)  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/drawing.py", line 1429, in _draw_multiple  
d.draw(renderer, draw_pass)  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/label/label2d.py", line 382, in draw  
if not self.update_drawing():  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/label/label2d.py", line 409, in update_drawing  
bold = l.bold, italic = l.italic)  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/drawing.py", line 2084, in text_image_rgba  
rgba = qimage_to_numpy(ti)  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/drawing.py", line 2024, in qimage_to_numpy  
buf = qi.bits().asstring(qi.byteCount())  
AttributeError: 'NoneType' object has no attribute 'asstring'  
  




OpenGL version: 4.1 NVIDIA-12.0.23 355.11.10.50.10.103
OpenGL renderer: NVIDIA GeForce GTX 675MX OpenGL Engine
OpenGL vendor: NVIDIA Corporation

Change History (2)

comment:1 by Eric Pettersen, 6 years ago

Component: UnassignedGraphics
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionEmpty (2D) label throws exception

comment:2 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Code that converts text to an image for rendering did not like an empty string. Was not sure how to handle an empty string 2d label -- should it show a background rectangle? Or simply not be drawn? I decided it should show a small background rectangle.

Note: See TracTickets for help on using tickets.