Previous 15994 Revisions Next

r15902 Wednesday 15th August, 2012 at 12:23:33 UTC by Miodrag Milanović
Properly detect click on artwork buttons when in fullscreen mode (no whatsnew)
[src/emu]render.c

src/emu/render.c
r15901r15902
19201920
19211921bool render_target::map_point_internal(INT32 target_x, INT32 target_y, render_container *container, float &mapped_x, float &mapped_y, const char *&mapped_input_tag, ioport_value &mapped_input_mask)
19221922{
1923   // compute the visible width/height
1924   INT32 viswidth, visheight;
1925   compute_visible_area(m_width, m_height, m_pixel_aspect, m_orientation, viswidth, visheight);
1926
1927   // create a root transform for the target
1928   object_transform root_xform;
1929   root_xform.xoffs = (float)(m_width - viswidth) / 2;
1930   root_xform.yoffs = (float)(m_height - visheight) / 2;
1931
19231932   // default to point not mapped
19241933   mapped_x = -1.0;
19251934   mapped_y = -1.0;
r15901r15902
19271936   mapped_input_mask = 0;
19281937
19291938   // convert target coordinates to float
1930   float target_fx = (float)target_x / m_width;
1931   float target_fy = (float)target_y / m_height;
1939   float target_fx = (float)(target_x - root_xform.xoffs) / viswidth;
1940   float target_fy = (float)(target_y - root_xform.yoffs) / visheight;
19321941
19331942   // explicitly check for the UI container
19341943   if (container != NULL && container == &m_manager.ui_container())
r15901r15902
19371946      if (target_fx >= 0.0 && target_fx < 1.0 && target_fy >= 0.0 && target_fy < 1.0)
19381947      {
19391948         // this point was successfully mapped
1940         mapped_x = target_fx;
1941         mapped_y = target_fy;
1949         mapped_x = (float)target_x / m_width;
1950         mapped_y = (float)target_y / m_height;
19421951         return true;
19431952      }
19441953      return false;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team