# Updating Makie subscene mouse click limits when zooming and panning

**URL:** https://discourse.julialang.org/t/updating-makie-subscene-mouse-click-limits-when-zooming-and-panning/43680
**Category:** General Usage
**Created:** [July 25, 2020, 9:38pm UTC](https://discourse.julialang.org/t/updating-makie-subscene-mouse-click-limits-when-zooming-and-panning/43680 "2020-07-25T21:38:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)
#### Post date: [July 25, 2020, 9:38pm UTC](https://discourse.julialang.org/t/updating-makie-subscene-mouse-click-limits-when-zooming-and-panning/43680/1 "2020-07-25T21:38:37Z")

</div>

This example:

```julia
using Makie, Random

scene = Scene(resolution = (1200, 1500))

scene1 = Scene(scene, IRect(0, 0, 1200, 900))
image = rand(1:4, 640, 480)
imagenode = Node(image)
image!(scene1, imagenode, scale_plot = false, show_axis = false, interpolate = false, colormap=[:white, :blue, :green, :red])

scene2 = Scene(scene, IRect(0, 900, 1200, 550))
polynode = Node(rand(Vec2f, 10))
lines!(scene2, polynode)

scene3 = Scene(scene, IRect(0, 1460, 1200, 40))
textnode = Node("text")
text!(scene3, textnode, show_axis = false)

display(scene)

on(scene1.events.mousebuttons) do buttons
  if ispressed(scene1, Mouse.left)
    pos = to_world(scene1, Point2f0(scene1.events.mouseposition[]))
    image[round.(Int, pos .+ 0.5)...] = 1
    imagenode[] = image
    polynode[] = rand(Vec2f, 10)
    textnode[] = "$(round.(Int, pos .+ 0.5))"
  end
end

# on(scene1.events.window_area) do _
# update!(scene1)
# end

```

restricts `scene1.events.mousebuttons` to `scene1` area until I zoom in. Then, clicks outside of visible `scene1` may be passed to the callback. I tried to change it with the last (commented out) lines, but it doesn’t help. What is the way to restrict mouse click events to the visible subscene area when zooming and panning?
