im creating a map-editor (recreating) a map editor for an RPG and im recreating it because screen movement needed to be implemented so that we could make bigger maps

Im having trouble drawing hitboxes in the editor so basically in the editor when you push H a rect is drawn from the click point to the next selected click pointit works fine before you move the screen position but after it gets all messed up

so before i move a rect is created from where the mouse is to where the mouse is when i push H againbut when i move the camera say 20 pixels up the rect is blitted 20 pixels down where the mouse should be

I would like to help but honestly I'm not so sure what the goal is here. You are probably going to want to create a tile map editor, but your hit boxes should probably be masks--and they would probably be better handled with code. You can have a sprite sheet with all the available tiles on it. Then you place the tiles and keep track of their coordinates in a dictionary. You then make it so you can have multiple layers of these tile dicts for one map. You make masks of each layer and if the player is in that particular layer he collides with those masks.