Opened 6 years ago

Closed 6 years ago

#2390 closed defect (fixed)

Changing 2D label to be very large fails

Reported by: goddard@… 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.7.0-x86_64-i386-64bit
ChimeraX Version: 0.91 (2019-09-04)
Description
Tried to change a 2d labels size to 300 pixels.

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

> open 4191 fromDatabase emdb

Opened emd_4191.map, grid size 926,926,71, pixel 13.7,13.7,13.7, shown at
level 966, step 2, values float32  

> save /Users/goddard/Desktop/image1.png supersample 3

> ui mousemode rightMode "crop volume"

> volume #1 region 0,0,0,925,925,9

> volume #1 region 0,0,0,925,925,5

> ui mousemode rightMode "move planes"

> volume #1 region 0,0,0,925,925,5

> volume #1 region 0,0,0,925,925,5

> volume scale #1 factor -1

> view orient cofr false

> view orient

> save /Users/goddard/Desktop/image1.png supersample 3

Expected a keyword  

> usage 2dlab

2dlabels [labels] [text a text string] [color color] [bgColor bgColor] [size
an integer] [font a text string] [bold true or false] [italic true or false]
[xpos a number] [ypos a number] [visibility true or false] [margin margin]
[outline outline] [frames an integer]  
— Create or change a 2d label  
labels: all or a 2d label name or a label models specifier  
color: default or a color  
bgColor: none or a color  
margin: a number ≥ 0  
outline: a number ≥ 0

2dlabels change labels [text a text string] [color color] [bgColor bgColor]
[size an integer] [font a text string] [bold true or false] [italic true or
false] [xpos a number] [ypos a number] [visibility true or false] [margin
margin] [outline outline] [frames an integer]  
— Change a 2d label  
labels: all or a 2d label name or a label models specifier  
color: default or a color  
bgColor: none or a color  
margin: a number ≥ 0  
outline: a number ≥ 0

2dlabels create name [text a text string] [color color] [bgColor bgColor]
[size an integer] [font a text string] [bold true or false] [italic true or
false] [xpos a number] [ypos a number] [visibility true or false] [margin
margin] [outline outline]  
— Create a 2d label  
name: a text string  
color: default or a color  
bgColor: none or a color  
margin: a number ≥ 0  
outline: a number ≥ 0

2dlabels delete [labels]  
— Delete a 2d label  
labels: all or a 2d label name or a label models specifier

2dlabels listfonts  
— List available fonts  

> 2dlabels text o color red size 50

> 2dlabels #3.1 size 200

> 2dlabels text o color red size 200

> view orient

> volume #2 region 0,0,41,925,925,41

> ui mousemode rightMode "move label"

> 2dlabels #3.1 xpos 0.368 ypos 0.410

> 2dlabels #3.2 xpos 0.243 ypos 0.163

> 2dlabels #3.1 xpos 0.341 ypos 0.433

> 2dlabels #3.2 xpos 0.131 ypos 0.044

> 2dlabels size 300

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/goddard/Desktop/ChimeraX Sep 4
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/updateloop.py", line 73, in draw_new_frame  
view.draw(check_for_changes = False)  
File "/Users/goddard/Desktop/ChimeraX Sep 4
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/view.py", line 173, in draw  
draw_overlays(odrawings, r)  
File "/Users/goddard/Desktop/ChimeraX Sep 4
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/drawing.py", line 1463, in draw_overlays  
_draw_multiple(drawings, r, Drawing.OPAQUE_DRAW_PASS)  
File "/Users/goddard/Desktop/ChimeraX Sep 4
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/drawing.py", line 1431, in _draw_multiple  
d.draw(renderer, draw_pass)  
File "/Users/goddard/Desktop/ChimeraX Sep 4
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/label/label2d.py", line 521, in draw  
if not self.update_drawing():  
File "/Users/goddard/Desktop/ChimeraX Sep 4
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/label/label2d.py", line 558, in update_drawing  
outline_width=l.outline_width)  
File "/Users/goddard/Desktop/ChimeraX Sep 4
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/drawing.py", line 2107, in text_image_rgba  
rgba = qimage_to_numpy(ti)  
File "/Users/goddard/Desktop/ChimeraX Sep 4
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/graphics/drawing.py", line 2027, in qimage_to_numpy  
buf = qi.bits().asstring(qi.byteCount())  
AttributeError: 'NoneType' object has no attribute 'asstring'  
  




OpenGL version: 4.1 ATI-2.11.20
OpenGL renderer: AMD Radeon Pro Vega 20 OpenGL Engine
OpenGL vendor: ATI Technologies Inc.

Change History (3)

in reply to:  1 ; comment:1 by goddard@…, 6 years ago

Creating the 2d label with size 300 does not produce an error.

comment:2 by Eric Pettersen, 6 years ago

Component: UnassignedGraphics
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionChanging 2D label to be very large fails

comment:3 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Error was from label with empty text, resulting in 0 size image. Made minimum image size 1. The empty image was because "2dlabel size 300" tried to create a new label. I expected it to change the size of all existing labels. I've changed this so specifying no label specifier (e.g. #2.1) and no text, applies changes to all labels.

Note: See TracTickets for help on using tickets.