* @param bounds - Initial bounds of the View
* @param colour - Colour to use for rendering this view. TODO: Make sure this actually works, or just remove it
*/
-View::View(Document & document, Screen & screen, const Rect & bounds, const Colour & colour)
+View::View(Document & document, Screen & screen, const VRect & bounds, const Colour & colour)
: m_use_gpu_transform(USE_GPU_TRANSFORM), m_use_gpu_rendering(USE_GPU_RENDERING), m_bounds_dirty(true), m_buffer_dirty(true),
m_render_dirty(true), m_document(document), m_screen(screen), m_cached_display(), m_bounds(bounds), m_colour(colour), m_bounds_ubo(),
m_objbounds_vbo(), m_object_renderers(NUMBER_OF_OBJECT_TYPES), m_cpu_rendering_pixels(NULL),
#endif
m_document.TranslateObjects(-x, -y, type);
#endif
- x *= m_bounds.w;
- y *= m_bounds.h;
- m_bounds.x += x;
- m_bounds.y += y;
+ m_bounds.x += m_bounds.w*VReal(x);
+ m_bounds.y += m_bounds.h*VReal(y);
//Debug("View Bounds => %s", m_bounds.Str().c_str());
#endif
m_document.ScaleObjectsAboutPoint(x, y, scale_amount, type);
#endif
- x *= m_bounds.w;
- y *= m_bounds.h;
- x += m_bounds.x;
- y += m_bounds.y;
+ VReal vx = m_bounds.w * VReal(x);
+ VReal vy = m_bounds.h * VReal(y);
+ vx += m_bounds.x;
+ vy += m_bounds.y;
- Real top = y - m_bounds.y;
- Real left = x - m_bounds.x;
+ VReal top = vy - m_bounds.y;
+ VReal left = vx - m_bounds.x;
top *= scale_amount;
left *= scale_amount;
- m_bounds.x = x - left;
- m_bounds.y = y - top;
+ m_bounds.x = vx - left;
+ m_bounds.y = vy - top;
m_bounds.w *= scale_amount;
m_bounds.h *= scale_amount;
//Debug("Scale at {%s, %s} by %s View Bounds => %s", x.Str().c_str(), y.Str().c_str(), scale_amount.Str().c_str(), m_bounds.Str().c_str());
#ifdef TRANSFORM_OBJECTS_NOT_VIEW
return inp;
#endif
- return TransformRectCoordinates(m_bounds, inp);
+ return TransformRectCoordinates(m_bounds.Convert<Real>(), inp);
}
/**