1. pygame
  2. pygame
  3. pygame
  4. Issues

Issues

Issue #46 resolved

White lines as called from aaline draw in yellow.

René Dudfield
created an issue

== John M, 2010-05-17 20:46:06 -0700

{{{ Created attachment 35 Result of attached code.

Something to do with Snow Leopard? Maybe this should be passed upstream to the SDL-guys but I was baffled.

Drawing over black background, a white line is drawn in yellow.

Very easy to reproduce: import pygame screen = pygame.display.set_mode( (200, 200), 0, 32 ) pygame.draw.line( screen, (255, 255, 255), (0,0), (100, 100) ) pygame.draw.aaline( screen, (255, 255, 255), (0,100), (100, 200) ) pygame.display.update()

I've attached what this produces. }}}


Attachments: [[http://www.pygame.org/old_bug_attachments/35/aalineBug.png| aalineBug.png]]

Comments (4)

  1. René Dudfield reporter
    • changed status to open
    • changed milestone to 1.9.2

    Here is an easier to run example, that also shows the problem is to do with the screen surface and the draw routine.

    import pygame
    from pygame.locals import *
    pygame.init()
    screen = pygame.display.set_mode( (200, 200), 0, 32 )
    surf = screen
    print "screen info", surf.get_masks(), surf.get_shifts(), surf.get_pitch(), surf.get_losses()
    surf = pygame.Surface( (200,200), 0, 32)
    print "surface info", surf.get_masks(), surf.get_shifts(), surf.get_pitch(), surf.get_losses()
    
    surf.fill((0,0,0,255))
    pygame.draw.line( surf, (255, 255, 255), (0,0), (100, 100) )
    pygame.draw.aaline( surf, (255, 255, 255), (0,100), (100, 200) )
    screen.blit(surf, (0,0))
    
    going = True
    while going:
        events = pygame.event.get()
        if QUIT in [e.type for e in events]:
            going = False
        pygame.display.update()
    

    On OSX Lion 64bit python it prints:

    screen info (65280, 16711680, 4278190080, 0) (8, 16, 24, 0) 800 (0, 0, 0, 8)
    surface info (16711680, 65280, 255, 0) (16, 8, 0, 0) 800 (0, 0, 0, 8)
    

    So we can see that the screen surface, and a normal software surface is laid out differently. So there must be an issue with the draw.aaline method and this type of memory layout.

    The example above shows a work around, of blitting to a normal surface and then blitting that surface to the screen. This works as expected and gives a white line, not a yellow one.

  2. Log in to comment