Feb-06-2021, 08:08 AM
(Feb-05-2021, 07:13 PM)nilamo Wrote:Hi, really thanks for helping , I tried fixing it again today thinking that the pixels are really tiny and tiny mouse movements are the issue. So, I tried filtering the values out by getting all the values in a list and checking if the last numbers are not the same as others but it creates more problems. After much thinking, I think pygame itself is not the lib for making a pixel editor. It does not support zooming other than pygame.transform.scale(). It is a bit hard and messed up for making a zoom function. Does not come with layers out of the box (Not sure). So, after some more research, I came across pyglet, which has more features for image editing like animation, (Don't know about zooming), etc.. I am thinking of moving to pyglet now as I haven't done a lot in the project and will be easier to shift now. And maybe will be more helpful in the long term. Making a pixel editor is definitely possible in pygame as many have made it and that was why I used pygame. But, I want this to be my main project that I keep improving. After looking into the docs of pyglet, pygame is wayy easier to work with than pyglet (I think). I am not really giving up because of the issue with pygame that I am facing, but if I face an issue with this small thing, I am scared what will happen when I get into some big mechanics. What do you guys think about pyglet? Is this a mistake?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
Thanks again