# Rectangles going to the top left corner

**URL:** <https://discourse.processing.org/t/rectangles-going-to-the-top-left-corner/13630>\
**Category:** Processing\
**Created:** [August 26, 2019, 7:52pm UTC](https://discourse.processing.org/t/rectangles-going-to-the-top-left-corner/13630 "2019-08-26T19:52:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thetinybros](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@thetinybros](https://discourse.processing.org/u/thetinybros)\
**Post date:** [August 26, 2019, 7:52pm UTC](https://discourse.processing.org/t/rectangles-going-to-the-top-left-corner/13630/1 "2019-08-26T19:52:54Z")

</div>

I’ve been programming with processing for about a year now, and one thing I never found out was why the lines on rectangles go to the top left of the screen instead of to the sides of the rectangle. Anyone else experience this issue?

> **code**
>
> ```auto
> void setup() {
> size(640, 320);
> }
> 
> void draw() {
> background(255);
> for (int i = 0; i < 32; i++) {
> for (int j = 0; j < 16; j++) {
> rect(i * 20, j * 20, i * 20 + 20, j * 20 + 20);
> }
> }
> }
> 
> ```

![picture](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/671cbca30ebd5244e42309695b06319e6f02eab4.png)

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [August 26, 2019, 9:20pm UTC](https://discourse.processing.org/t/rectangles-going-to-the-top-left-corner/13630/2 "2019-08-26T21:20:22Z")

</div>

Seems like we have different output:

 ![thetinybros](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/772454128592f446a6f52f49a56eecbc2dc0b1df.png)

---

<div class="post-metadata">

**Author:** ![thetinybros](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@thetinybros](https://discourse.processing.org/u/thetinybros)\
**Post date:** [August 26, 2019, 9:49pm UTC](https://discourse.processing.org/t/rectangles-going-to-the-top-left-corner/13630/3 "2019-08-26T21:49:35Z")

</div>

Yeah, my computer is probably just garbage.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [August 26, 2019, 9:56pm UTC](https://discourse.processing.org/t/rectangles-going-to-the-top-left-corner/13630/4 "2019-08-26T21:56:59Z")

</div>

This definitely should not be happening. Might be incompatible graphics card, out of date driver, or bad RAM. Seen things like it in the past, and they were generally hardware:

- [https://forum.processing.org/two/discussion/22222/solved-rect-stroke-bug](https://forum.processing.org/two/discussion/22222/solved-rect-stroke-bug)

Try switching renderer to FX2D, for example `size(400, 400, FX2D)` as a potential workaround.
