# Python draw with different Y axis

I have an addon with that you can define widgets (like panels) that are drawn into the 3d view. The are defined using gpu module, that has this coordinate system:

So the widget would be at about (800, 100), but of course the user would rather define the panel like this (upper left hand corner is origin):

I already keep the x and y in a separate Python class and I paint the panel with the gpu module like this:

def update(self, x, y):

self.x_screen = x
self.y_screen = y

indices = ((0, 1, 2), (0, 2, 3))

# bottom left, top left, top right, bottom right
vertices = (
(self.x_screen, self.y_screen),
(self.x_screen, self.y_screen - self.height),
(self.x_screen + self.width, self.y_screen - self.height),
(self.x_screen + self.width, self.y_screen))



Is there a nice way to convert the Y-axis so that I dont have to recalculate the Y-axis manually to define the vertices of the batch?