# DrawableButton::ImageFitted needs a small tweak?

**URL:** <https://forum.juce.com/t/drawablebutton-imagefitted-needs-a-small-tweak/12309>\
**Category:** General JUCE discussion\
**Created:** [February 3, 2014, 7:38pm UTC](https://forum.juce.com/t/drawablebutton-imagefitted-needs-a-small-tweak/12309 "2014-02-03T19:38:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [February 3, 2014, 7:38pm UTC](https://forum.juce.com/t/drawablebutton-imagefitted-needs-a-small-tweak/12309/1 "2014-02-03T19:38:15Z")

</div>

It seems that because ImageFitted centre the image, the path will be blured if the button width and height are not a factor of 2.  
Not sure what's the best thing to do about it ..&nbsp;  
perhaps you could remove 0.5 on each side before resizing?

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [February 3, 2014, 7:57pm UTC](https://forum.juce.com/t/drawablebutton-imagefitted-needs-a-small-tweak/12309/2 "2014-02-03T19:57:00Z")

</div>

hum.. wait, that's not the cause right?

it just seem I can't get my simple path always pixel aligned, it changes when I resize the button. not sure what I&nbsp;can do about that.

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 3, 2014, 8:07pm UTC](https://forum.juce.com/t/drawablebutton-imagefitted-needs-a-small-tweak/12309/3 "2014-02-03T20:07:26Z")

</div>

You can't assume that 1 unit = 1 pixel any more. Your window may be running at any kind of scaled resolution, so that even if you align the pixels by their number, they don't necessarily align with whole pixels. That's why vector graphics or higher-res images are the smart way to do your graphics nowadays.

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [February 3, 2014, 8:31pm UTC](https://forum.juce.com/t/drawablebutton-imagefitted-needs-a-small-tweak/12309/4 "2014-02-03T20:31:00Z")

</div>

ok,&nbsp;but (sorry for the basic question), i'm just drawing a path,&nbsp;isn't that part of what is called vector graphics ?

to be sure every thing is aligned,&nbsp;how would I go to draw such a simple path as that in a button in a vector graphic way&nbsp;?

or is that just that I can't be sure in will be perfectly aligned when resized?

```
    static const unsigned char pathData[] = { 110,109,0,0,0,66,4,112,185,62,108,0,0,0,66,0,151,139,64,98,112,20,186,65,0,151,139,64,0,0,160,64,0,151,139,64,0,0,160,64,0,151,139,64,108,0,0,160,64,0,46,23,64,98,0,0,160,64,0,46,23,64,39,174,21,64,0,46,23,64,0,0,0,64,0,46,23,64,98,58,65,249,63,105,15,
        145,64,0,0,0,64,198,209,193,64,0,0,0,64,128,203,5,65,98,148,20,76,64,128,203,5,65,0,0,160,64,128,203,5,65,0,0,160,64,128,203,5,65,98,0,0,160,64,0,151,235,64,0,0,160,64,0,151,203,64,0,0,160,64,0,151,203,64,98,0,0,160,64,0,151,203,64,225,36,182,65,0,151,
        203,64,0,0,0,66,0,151,203,64,108,0,0,0,66,128,203,37,65,98,0,0,0,66,128,203,37,65,68,196,23,66,25,13,171,64,0,0,24,66,255,150,171,64,99,101,0,0 };
```

&nbsp;

```
svg path :
"m 32,0.36218274 0,3.99999986 c -8.740021,0 -27,0 -27,0 l 0,-2 c 0,0 -2.6612457,0 -3,0 -0.052697,2.1709486 0,3.6946747 0,6 1.1887561,0 3,0 3,0 0,-1 0,-2 0,-2 0,0 17.768007,0 27,0 l 0,4.0000004 c 0,0 5.941666,-5.0168338 6,-5.0000004 z"
```

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 4, 2014, 8:49am UTC](https://forum.juce.com/t/drawablebutton-imagefitted-needs-a-small-tweak/12309/5 "2014-02-04T08:49:28Z")

</div>

(Sorry, for some reason I thought you were talking about&nbsp;images..)

Well, it's easier with paths, but really the same thing applies no matter how the pixels were generated - it's really optimistic to expect to be able to align the pixels when you've no idea what scale will be getting applied before it hits the screen. Especially on Windows, the desktop scale will often be a non-integer multiple.
