# Move camera(view) over edge of map

**URL:** <https://discourse.mapeditor.org/t/move-camera-view-over-edge-of-map/1753>\
**Category:** Suggestions\
**Created:** [October 21, 2016, 2:35pm UTC](https://discourse.mapeditor.org/t/move-camera-view-over-edge-of-map/1753 "2016-10-21T14:35:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![buckle2000](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@buckle2000](https://discourse.mapeditor.org/u/buckle2000)\
**Post date:** [October 21, 2016, 2:35pm UTC](https://discourse.mapeditor.org/t/move-camera-view-over-edge-of-map/1753/1 "2016-10-21T14:35:32Z")

</div>

Currently in Tiled (Qt), map cannot be scrolled out of the screen.  
This is annoying because sometimes I need to place objects outside the map.

---

<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:** [October 21, 2016, 3:29pm UTC](https://discourse.mapeditor.org/t/move-camera-view-over-edge-of-map/1753/2 "2016-10-21T15:29:49Z")

</div>

Maybe you should update your version of Tiled, because I’ve enabled scrolling past the edges of the map in [Tiled 0.15](http://discourse.mapeditor.org/t/tiled-0-15-0-released/1001).

---

<div class="post-metadata">

**Author:** ![buckle2000](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@buckle2000](https://discourse.mapeditor.org/u/buckle2000)\
**Post date:** [October 21, 2016, 3:55pm UTC](https://discourse.mapeditor.org/t/move-camera-view-over-edge-of-map/1753/3 "2016-10-21T15:55:41Z")

</div>

I figured it out…  
I am using version 0.17.1224, latest snapshot.  
I can scroll past edges of map using “minimap” or middle mouse button, but not I can scroll past edges of map using mouse wheel.

---

<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:** [October 21, 2016, 7:50pm UTC](https://discourse.mapeditor.org/t/move-camera-view-over-edge-of-map/1753/4 "2016-10-21T19:50:12Z")

</div>

Hmm, right, I could look into allowing it when using the mouse wheel as well. Can’t remember now whether there was some difficulty with this (since mouse wheel is currently handled by Qt) or whether I just thought it might not be a good idea.

---

<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:** [October 24, 2016, 10:47am UTC](https://discourse.mapeditor.org/t/move-camera-view-over-edge-of-map/1753/5 "2016-10-24T10:47:29Z")

</div>

Well, I think I originally didn’t do this because I based the over-edge scrolling behavior on GIMP, which also doesn’t allow this. I looked into overriding the bounds checking, but it was not easily possible because it is buried inside `QAbstractSliderPrivate::scrollByDelta`. So I decided to override the wheel event handling entirely, reimplementing part of its logic:

[https://github.com/bjorn/tiled/commit/dab4f29c1acc9adeb2c2ffff1afe763509fd7832](https://github.com/bjorn/tiled/commit/dab4f29c1acc9adeb2c2ffff1afe763509fd7832)

This change still needs to be tested on a system that supports `QWheelEvent::pixelDelta` (so with a high-precision mouse, usually). I’ll check whether my Mac Mini does, though it has a regular mouse attached to it.
