mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Pass through the code to address clang-tidy linting (#3083)
This commit is contained in:
@@ -77,19 +77,18 @@ RenderablePlaneImageOnline::RenderablePlaneImageOnline(
|
||||
}
|
||||
|
||||
// Shape the plane based on the aspect ration of the image
|
||||
glm::vec2 textureDim = glm::vec2(_texture->dimensions());
|
||||
const glm::vec2 textureDim = glm::vec2(_texture->dimensions());
|
||||
if (_textureDimensions != textureDim) {
|
||||
float aspectRatio = textureDim.x / textureDim.y;
|
||||
float planeAspectRatio = _size.value().x / _size.value().y;
|
||||
const float aspectRatio = textureDim.x / textureDim.y;
|
||||
const float planeAspectRatio = _size.value().x / _size.value().y;
|
||||
|
||||
if (std::abs(planeAspectRatio - aspectRatio) >
|
||||
std::numeric_limits<float>::epsilon())
|
||||
{
|
||||
glm::vec2 newSize =
|
||||
_size =
|
||||
aspectRatio > 0.f ?
|
||||
glm::vec2(_size.value().x * aspectRatio, _size.value().y) :
|
||||
glm::vec2(_size.value().x, _size.value().y * aspectRatio);
|
||||
_size = newSize;
|
||||
}
|
||||
|
||||
_textureDimensions = textureDim;
|
||||
@@ -129,7 +128,7 @@ void RenderablePlaneImageOnline::update(const UpdateData& data) {
|
||||
}
|
||||
|
||||
if (_imageFuture.valid() && DownloadManager::futureReady(_imageFuture)) {
|
||||
DownloadManager::MemoryFile imageFile = _imageFuture.get();
|
||||
const DownloadManager::MemoryFile imageFile = _imageFuture.get();
|
||||
|
||||
if (imageFile.corrupted) {
|
||||
LERRORC(
|
||||
@@ -165,19 +164,18 @@ void RenderablePlaneImageOnline::update(const UpdateData& data) {
|
||||
}
|
||||
|
||||
// Shape the plane based on the aspect ration of the image
|
||||
glm::vec2 textureDim = glm::vec2(_texture->dimensions());
|
||||
const glm::vec2 textureDim = glm::vec2(_texture->dimensions());
|
||||
if (_textureDimensions != textureDim) {
|
||||
float aspectRatio = textureDim.x / textureDim.y;
|
||||
float planeAspectRatio = _size.value().x / _size.value().y;
|
||||
const float aspectRatio = textureDim.x / textureDim.y;
|
||||
const float planeAspectRatio = _size.value().x / _size.value().y;
|
||||
|
||||
if (std::abs(planeAspectRatio - aspectRatio) >
|
||||
std::numeric_limits<float>::epsilon())
|
||||
{
|
||||
glm::vec2 newSize =
|
||||
_size =
|
||||
aspectRatio > 0.f ?
|
||||
glm::vec2(_size.value().x * aspectRatio, _size.value().y) :
|
||||
glm::vec2(_size.value().x, _size.value().y * aspectRatio);
|
||||
_size = newSize;
|
||||
}
|
||||
|
||||
_textureDimensions = textureDim;
|
||||
|
||||
Reference in New Issue
Block a user