Python Forum
Drawn line shift when that surface is copied to another in pygame
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drawn line shift when that surface is copied to another in pygame
#2
Quote:
            if event.type == pygame.MOUSEMOTION:
                pre_view == pygame.Surface.copy(canvas)

That's probably not what you wanted (comparison on the second line, instead of assignment). That said, I don't think it's the issue, as I still notice it after fixing it.

I'm not sure what the issue is. It looks like only the end point is shifting, and only a tiny amount, and it seems like it only sometimes does it. The only thing I can think of, is that the mouse moves a tiny bit between getting the last position and releasing the mouse button.

I think the way I'd try to fix it, is to maintain a start/end point in a list of operations, and recreate the surfaces based on the list of operations. But I also realize that isn't really fixing anything, and just trying to move on by using a different method of doing it haha
Leo_Red likes this post
Reply


Messages In This Thread
RE: Drawn line shift when that surface is copied to another in pygame - by nilamo - Feb-05-2021, 07:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Surface and rectangle in pygame Fabrizio_fg 6 2,553 May-27-2023, 09:15 AM
Last Post: Fabrizio_fg
  [PyGame] Pygame is treating blob_group as a surface, when I need it to treat it as a Sprite. Swagford 1 1,371 Jan-24-2023, 09:58 PM
Last Post: metulburr
  Coloring a surface with transparency Sandor 4 2,408 Jan-02-2022, 08:11 AM
Last Post: Sandor
  [PyGame] pygame.Surface.fill help Shemira 3 6,296 Nov-29-2019, 12:01 AM
Last Post: Shemira
  pygame and shift branching? MuntyScruntfundle 2 3,461 Feb-23-2019, 01:39 PM
Last Post: Windspar
  pygame.surface Graham 10 8,624 Nov-29-2018, 04:45 PM
Last Post: nilamo
  [PyGame] PLEASE HELP! TypeError: unsupported operand type(s) for +: 'pygame.Surface' and 'int' keyfive 1 5,375 Jun-19-2018, 01:20 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020