 
     if(x > w / 2)
       console.log("right hand side")
+      control_rotate_circle.style.left = x - control_rotate_circle_offset + "px"
+      control_rotate_circle.style.top = y - control_rotate_circle_offset + "px"
+
     else
       console.log("left hand side")
+      control_pan_circle.style.left = x - control_pan_circle_offset + "px"
+      control_pan_circle.style.top = y - control_pan_circle_offset + "px"
 
     i++
   return

m_ctl = b4w.require("controls")

vec2_tmp = new Float32Array(2)

$ ->
  $(window).resize ->

  pan_left_arrow = m_ctl.create_custom_sensor(0)
  pan_up_arrow = m_ctl.create_custom_sensor(0)
  pan_down_arrow = m_ctl.create_custom_sensor(0)
  control_rotate_circle = document.getElementById("control_rotate_circle")
  control_pan_circle = document.getElementById("control_pan_circle")
  control_rotate_circle_offset = control_rotate_circle.clientWidth / 2
  control_pan_circle_offset = control_pan_circle.clientWidth / 2

  document.getElementById("b4w-overlay").addEventListener("touchstart", touch_start_cb, false)
  document.getElementById("b4w-overlay").addEventListener("touchmove", touch_move_cb, false)
  document.getElementById("b4w-overlay").addEventListener("touchend", touch_end_cb, false)
