Why Java 2D origin is at the top left corner?

后端 未结 10 894
我寻月下人不归
我寻月下人不归 2021-01-04 23:19

I\'m not complaining, just wonder. Why Java use top left point of the drawing surface as origin? I assume more natural is to choose left bottom corner as origin and increase

10条回答
  •  感动是毒
    2021-01-04 23:50

    It always worked like this.

    Back in the assembly days, pixel one has always been on the top left corner. It was the first pixel or character that the user could read.

    This way of numbering things allows you to have a infinitely long image or text. If you started from bottom left and you wanted to add a new line, you'd have to shift all your stuff and recalculate coordinates for everything.

提交回复
热议问题