# Negative value in world offset value

**URL:** <https://discourse.mapeditor.org/t/negative-value-in-world-offset-value/3963>\
**Category:** Questions\
**Created:** [June 17, 2019, 8:49pm UTC](https://discourse.mapeditor.org/t/negative-value-in-world-offset-value/3963 "2019-06-17T20:49:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patryk\_Gwiazdowski](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/patryk_gwiazdowski/32/2352_2.png) [@Patryk\_Gwiazdowski](https://discourse.mapeditor.org/u/Patryk_Gwiazdowski)\
**Post date:** [June 17, 2019, 8:49pm UTC](https://discourse.mapeditor.org/t/negative-value-in-world-offset-value/3963/1 "2019-06-17T20:49:50Z")

</div>

Hello, i have world file looking like that:

```json
    {
    "patterns": [
        {
            "regexp": "map_*(\\d+)_*(\\d+)\\.tmx",
            "multiplierX": 16,
            "multiplierY": 16,
            "offsetX": 0,
            "offsetY": 0
        }
    ],
    "type": "world"
}

```

Problem is that my game engine renders particular chunks in different order than tiled does. Quickest fix to that problem that came to my mind is simply put negative multiplier here. Unfortunately chunks were rendered like multiplier is set to 0.  
Is there any way to set multiplier to negative value? Or i’m missing something? If that’s not possible. Then consider that Question as feature request 😉

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 19, 2019, 8:08am UTC](https://discourse.mapeditor.org/t/negative-value-in-world-offset-value/3963/2 "2019-06-19T08:08:23Z")

</div>

Hey @Patryk_Gwiazdowski, welcome to the Tiled forums!

> [@Patryk\_Gwiazdowski](#):
>
> Is there any way to set multiplier to negative value? Or i’m missing something?

You found a bug. 🙂 I’ve fixed it now in the following change:

> <https://github.com/mapeditor/tiled/commit/39a79eeff258bbd62876c6914651816814e1d480>
>
> It was invalidating the pattern since the mapWidth/mapHeight properties
> defaulte…d to values of multiplierX/multiplierY, without taking the
> absolute value, and negative map sizes are invalid.
> 
> So, a workaround for those affected would be to explicitly set the
> mapWidth/mapHeight properties to the appropriate positive value.
> 
> Tiled-forum: https://discourse.mapeditor.org/t/negative-value-in-world-offset-value/3963

So, the problem was that the `mapWidth` and `mapHeight` attributes are defaulting to the values of the `multiplierX` and `multiplierY` respectively. This usually makes sense, but not if you’re using a negative multiplier. Now they default to the absolute value of the multiplier.

To work around this bug, you can set the `mapWidth` and `mapHeight` properties explicitly.

Btw, note that the eventual value is in pixels. As such a multiplier of 16 seems a bit on the low end. You’ll likely want to multiply this by your tile size, if your maps are 16x16 in tiles.

---

<div class="post-metadata">

**Author:** ![Patryk\_Gwiazdowski](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/patryk_gwiazdowski/32/2352_2.png) [@Patryk\_Gwiazdowski](https://discourse.mapeditor.org/u/Patryk_Gwiazdowski)\
**Post date:** [June 19, 2019, 9:46pm UTC](https://discourse.mapeditor.org/t/negative-value-in-world-offset-value/3963/3 "2019-06-19T21:46:22Z")

</div>

Thanks for such quick response and fix!
