Simplify wxWebView zoom conversion code
So there is no need to "shut up compilers"
This commit is contained in:
parent
1508fa1e4c
commit
1406d3dc03
@ -57,30 +57,24 @@ wxWebViewZoom wxWebView::GetZoom() const
|
||||
float zoom = GetZoomFactor();
|
||||
|
||||
// arbitrary way to map float zoom to our common zoom enum
|
||||
if (zoom <= 0.55)
|
||||
if (zoom <= 0.55f)
|
||||
{
|
||||
return wxWEBVIEW_ZOOM_TINY;
|
||||
}
|
||||
else if (zoom > 0.55 && zoom <= 0.85)
|
||||
if (zoom <= 0.85f)
|
||||
{
|
||||
return wxWEBVIEW_ZOOM_SMALL;
|
||||
}
|
||||
else if (zoom > 0.85 && zoom <= 1.15)
|
||||
if (zoom <= 1.15f)
|
||||
{
|
||||
return wxWEBVIEW_ZOOM_MEDIUM;
|
||||
}
|
||||
else if (zoom > 1.15 && zoom <= 1.45)
|
||||
if (zoom <= 1.45f)
|
||||
{
|
||||
return wxWEBVIEW_ZOOM_LARGE;
|
||||
}
|
||||
else if (zoom > 1.45)
|
||||
{
|
||||
return wxWEBVIEW_ZOOM_LARGEST;
|
||||
}
|
||||
|
||||
// to shut up compilers, this can never be reached logically
|
||||
wxFAIL_MSG("unreachable");
|
||||
return wxWEBVIEW_ZOOM_MEDIUM;
|
||||
return wxWEBVIEW_ZOOM_LARGEST;
|
||||
}
|
||||
|
||||
void wxWebView::SetZoom(wxWebViewZoom zoom)
|
||||
|
Loading…
Reference in New Issue
Block a user