Example #1
0
GsRect<Uint16> GsWeakSurface::calcBlitRect(const GsRect<float> &rect)
{
    GsRect<Uint16> absRect(0, 0, mpSurface->w, mpSurface->h);

    absRect.transform(rect);
    return absRect;
}
void QmlWebViewWidget::updateGeometry()
{
    QPointF newPos(0, 0);
    newPos = mapToItem(0, newPos);
    qDebug() << "QmlWebViewWidget::updateGeometry, top left mapped to window: " << newPos;

    if(this->window()){
    newPos += this->window()->position();
    qDebug() << "QmlWebViewWidget::updateGeometry, top left mapped to screen: " << newPos;
    }
    QRectF absRect(newPos, contentsBoundingRect().size());
    m_widget->setGeometry(absRect.toRect());
}
Example #3
0
/*************************************************************************
	Handler for when frame state changes.
*************************************************************************/
void StaticImage::onStaticFrameChanged(WindowEventArgs& e)
{
	// base class processing
	Static::onStaticFrameChanged(e);

	// update the size and position of the image to reflect changes made
	// to the frame in the base class
	Rect absRect(getUnclippedPixelRect());
	Rect innerRect(getUnclippedInnerRect());
	d_image.setSize(innerRect.getSize());
	d_image.setPosition(Point(innerRect.d_left - absRect.d_left, innerRect.d_top - absRect.d_top));

	e.handled = true;
}