Simplify zoom conversion code

so there is no need to "shut up compilers"
This commit is contained in:
Paul Cornett 2017-06-15 10:21:54 -07:00
parent 4e55fca038
commit 47dc046b1e
2 changed files with 8 additions and 22 deletions

View File

@ -747,26 +747,19 @@ wxWebViewZoom wxWebViewWebKit::GetZoom() const
{ {
return wxWEBVIEW_ZOOM_TINY; return wxWEBVIEW_ZOOM_TINY;
} }
else if (zoom > 0.65 && zoom <= 0.90) if (zoom <= 0.90)
{ {
return wxWEBVIEW_ZOOM_SMALL; return wxWEBVIEW_ZOOM_SMALL;
} }
else if (zoom > 0.90 && zoom <= 1.15) if (zoom <= 1.15)
{ {
return wxWEBVIEW_ZOOM_MEDIUM; return wxWEBVIEW_ZOOM_MEDIUM;
} }
else if (zoom > 1.15 && zoom <= 1.45) if (zoom <= 1.45)
{ {
return wxWEBVIEW_ZOOM_LARGE; return wxWEBVIEW_ZOOM_LARGE;
} }
else if (zoom > 1.45) return wxWEBVIEW_ZOOM_LARGEST;
{
return wxWEBVIEW_ZOOM_LARGEST;
}
// to shut up compilers, this can never be reached logically
wxFAIL;
return wxWEBVIEW_ZOOM_MEDIUM;
} }

View File

@ -855,26 +855,19 @@ wxWebViewZoom wxWebViewWebKit::GetZoom() const
{ {
return wxWEBVIEW_ZOOM_TINY; return wxWEBVIEW_ZOOM_TINY;
} }
else if (zoom > 0.65 && zoom <= 0.90) if (zoom <= 0.90)
{ {
return wxWEBVIEW_ZOOM_SMALL; return wxWEBVIEW_ZOOM_SMALL;
} }
else if (zoom > 0.90 && zoom <= 1.15) if (zoom <= 1.15)
{ {
return wxWEBVIEW_ZOOM_MEDIUM; return wxWEBVIEW_ZOOM_MEDIUM;
} }
else if (zoom > 1.15 && zoom <= 1.45) if (zoom <= 1.45)
{ {
return wxWEBVIEW_ZOOM_LARGE; return wxWEBVIEW_ZOOM_LARGE;
} }
else if (zoom > 1.45) return wxWEBVIEW_ZOOM_LARGEST;
{
return wxWEBVIEW_ZOOM_LARGEST;
}
// to shut up compilers, this can never be reached logically
wxFAIL;
return wxWEBVIEW_ZOOM_MEDIUM;
} }