# Sketch doesn't scale right with size() function

**URL:** <https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396>\
**Category:** Processing\
**Created:** [June 7, 2022, 10:15pm UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396 "2022-06-07T22:15:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![karo](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@karo](https://discourse.processing.org/u/karo)\
**Post date:** [June 7, 2022, 10:15pm UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/1 "2022-06-07T22:15:58Z")

</div>

Hey there,  
lately i got an new surface 8pro, and i directly wanted to start coding on it as well as on my desktop work station.  
But there is a problem, because the sketch on the new laptop does not run with the correct size:

the surface (windows 11) has a screen resolution of (2880x1920 Pixels) and is scale in the display settings is 200%. If im running a program with only 1400x800 pixels its almost full screen.

this problem i never had on my desktop display, which is a 4k monitor, and is scaled by 175% in the display settings on windows 10.

does anyone have any idea how, i can run a sketch on the surface, that has exactly the right height and width in Pixels?

thank you very much in advance, if my explanation was not understandable pls dont hesitate to ask questions. (and sorry for my english, which i know isnt very good)

---

<div class="post-metadata">

**Author:** ![Mikey83](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mikey83/32/17956_2.png) [@Mikey83](https://discourse.processing.org/u/Mikey83)\
**Post date:** [June 8, 2022, 12:24am UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/2 "2022-06-08T00:24:37Z")

</div>

Instead of size() try surface.setSize(), im not sure if that will help but seen a similar question the other day and trying to see if it helps

---

<div class="post-metadata">

**Author:** ![karo](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@karo](https://discourse.processing.org/u/karo)\
**Post date:** [June 8, 2022, 1:53pm UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/3 "2022-06-08T13:53:56Z")

</div>

hey Mikey,  
thanks for your answer, but sadly it did not work for me.  
I tried to implement it in the settings and in the setup method,but neither did work -.-  
If you have any other advice i would love to hear it.

---

<div class="post-metadata">

**Author:** ![Mikey83](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mikey83/32/17956_2.png) [@Mikey83](https://discourse.processing.org/u/Mikey83)\
**Post date:** [June 8, 2022, 2:16pm UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/4 "2022-06-08T14:16:07Z")

</div>

Thats sad then, are you using version 4? the issue the other person was having seemed to be with 4, maybe something in the core program thats clashing with windows 11 as they were using that too

---

<div class="post-metadata">

**Author:** ![karo](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@karo](https://discourse.processing.org/u/karo)\
**Post date:** [June 8, 2022, 4:28pm UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/5 "2022-06-08T16:28:01Z")

</div>

Oh yes, that actually might be the problem, since I’m still using the version 3 on my desktop pc but downloaded version 4 for the surface.

I’ll try it when I’m back home.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [June 8, 2022, 4:39pm UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/6 "2022-06-08T16:39:25Z")

</div>

It might also be something related to hires displays have a look at [pixelDensity](https://processing.org/reference/pixelDensity_.html), try values 1 or 2 and see if that helps.

---

<div class="post-metadata">

**Author:** ![karo](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@karo](https://discourse.processing.org/u/karo)\
**Post date:** [June 8, 2022, 5:01pm UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/7 "2022-06-08T17:01:56Z")

</div>

@quark i have tried your idea first in the latest processing4 version, but it did not changed the sketch size in pixels or the pixeldensity in the sketch, only the shapes the sketch draws got somehow bigger.  
But thanks for the idea anyway.

@Mikey83 With the latest processing 3 Version it works fine. Thank you very much for the hint. Do you know where i can report this little bug?

---

<div class="post-metadata">

**Author:** ![Mikey83](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mikey83/32/17956_2.png) [@Mikey83](https://discourse.processing.org/u/Mikey83)\
**Post date:** [June 8, 2022, 5:22pm UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/8 "2022-06-08T17:22:37Z")

</div>

@karo im sure it has already been reported numerous times, clearly its a compatibility issue, whether thats on windows 11 or processing 4’s side, i couldn’t tell you, but there does seem to be an issue

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 9, 2022, 10:46am UTC](https://discourse.processing.org/t/sketch-doesnt-scale-right-with-size-function/37396/9 "2022-06-09T10:46:50Z")

</div>

Hello @karo,

Related topic here:

> [@Disable scaling](https://discourse.processing.org/t/disable-scaling/37417):
>
> I use 200% scaling on my desktop to be able to read, but it causes the output window to be twice as large. Everything looks super aliased too. Is there a way to disable scaling on the display window?

You may find an issue in here:

> **[Issues · benfry/processing4](https://github.com/benfry/processing4/issues)**
>
> Processing 4.x releases for Java 17. Contribute to benfry/processing4 development by creating an account on GitHub.

`:)`
