diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index a020aa501c..f19d1dbd95 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -744,7 +744,7 @@ void WidgetsFrame::InitBook() wxTreeItemIdValue cookie; tree->EnsureVisible(tree->GetFirstChild(tree->GetRootItem(), cookie)); - tree->SetMinSize(wxSize(tree->GetBestSize().GetWidth() * 1.1, wxDefaultCoord)); + tree->SetMinSize(wxSize(tree->GetBestSize().GetWidth() * 9 / 8, wxDefaultCoord)); #else if ( !pageSet || !m_book->GetCurrentPage() ) { diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp index 4b082f294e..06fe094b30 100644 --- a/src/gtk/webview_webkit2.cpp +++ b/src/gtk/webview_webkit2.cpp @@ -1021,7 +1021,7 @@ void wxWebViewWebKit::SetWebkitZoom(float level) float wxWebViewWebKit::GetWebkitZoom() const { - return webkit_web_view_get_zoom_level(m_web_view); + return float(webkit_web_view_get_zoom_level(m_web_view)); } void wxWebViewWebKit::EnableAccessToDevTools(bool enable) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 712d5dc19c..605e1f304f 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -212,7 +212,7 @@ wxSize wxQtDCImpl::GetPPI() const if (!srn) return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY()); qreal dotsPerInch = srn->logicalDotsPerInch(); - return wxSize(round(dotsPerInch), round(dotsPerInch)); + return wxSize(std::lround(dotsPerInch), std::lround(dotsPerInch)); } void wxQtDCImpl::SetFont(const wxFont& font) diff --git a/src/qt/graphics.cpp b/src/qt/graphics.cpp index 3ef5688f47..597e5aa3a9 100644 --- a/src/qt/graphics.cpp +++ b/src/qt/graphics.cpp @@ -1562,12 +1562,14 @@ wxQtGraphicsRenderer::CreateSubBitmap(const wxGraphicsBitmap& bitmap, const int srcHeight = sourcePixmap.height(); const int dstWidth = wxRound(w); const int dstHeight = wxRound(h); + const int dstX = wxRound(x); + const int dstY = wxRound(y); - wxCHECK_MSG(x >= 0.0 && y >= 0.0 && dstWidth > 0 && dstHeight > 0 && - x + dstWidth <= srcWidth && y + dstHeight <= srcHeight, + wxCHECK_MSG(dstX >= 0 && dstY >= 0 && dstWidth > 0 && dstHeight > 0 && + dstX + dstWidth <= srcWidth && dstY + dstHeight <= srcHeight, wxNullGraphicsBitmap, wxS("Invalid bitmap region")); - QPixmap subPixmap = sourcePixmap.copy(x, y, w, h); + QPixmap subPixmap = sourcePixmap.copy(dstX, dstY, dstWidth, dstHeight); wxGraphicsBitmap bmpRes; bmpRes.SetRefData(new wxQtBitmapData(this, subPixmap));