• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vispy / vispy / 26032872029
75%

Build:
DEFAULT BRANCH: main
Ran 18 May 2026 12:18PM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
26032872029

push

github

web-flow
Fix: Account for newline when positioning first text character (#2728)

I observed an issue in a napari example:
https://napari.org/stable/gallery/3Dimage_plane_rendering.html, as
observed in the lower right of the screenshot, the first word "shift" is
missing its "s". I was aided by Copilot to track this down to Vispy's
calculation of the first position of the character. If the first
character has "0" as its value for vi which is how I understand `/n`)
then it would not be positioned properly.
This PR uses the iterating index and its offset so that no matter the
value of the first character, letters will get positioned correctly. I
actually don't know if this is the correct fix because vispy code is not
my forte.

I modified the text example to show this:
```python
import sys

from vispy import scene
from vispy.scene.visuals import Text

# Create canvas with a viewbox at the lower half
canvas = scene.SceneCanvas(keys='interactive')
vb = scene.widgets.ViewBox(parent=canvas.scene, border_color='b')


@canvas.events.resize.connect
def resize(event=None):
    vb.pos = 1, canvas.size[1] // 2 - 1
    vb.size = canvas.size[0] - 2, canvas.size[1] // 2 - 2

test_text = (
"""
abcdefg
hijklgmnop
"""
)

t1 = Text(test_text, parent=canvas.scene, color='red')
t1.font_size = 24
t1.pos = canvas.size[0] // 2, canvas.size[1] // 3

if __name__ == '__main__':
    canvas.show()
    if sys.flags.interactive != 1:
        canvas.app.run()
```


Main: 

<img width="1191" height="897" alt="image"
src="https://github.com/user-attachments/assets/2e23f6ca-17fc-42e6-8460-335fa5119231"
/>


This PR:

<img width="1194" height="898" alt="image"
src="https://github.com/user-attachments/assets/3ca36fe8-2981-4217-b473-b48f03067cda"
/>
Source Files on build 26032872029
Detailed source file information is not available for this build.
  • Back to Repo
  • 0d42e645 on github
  • Prev Build on main (#24896915642)
  • Next Build on main (#26033227691)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc