Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Basit Ayantunde committed Dec 12, 2023
1 parent 6eb8ca9 commit 6aa751f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ashura/subsystems/http_client.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ashura/utils.h"
#include "ashura/subsystems/http_client.h"
#include "ashura/utils.h"

namespace ash
{
Expand Down
4 changes: 2 additions & 2 deletions ashura/subsystems/image_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include "ashura/image_decoder.h"
#include "ashura/primitives.h"
#include "ashura/subsystem.h"
#include "ashura/utils.h"
#include "stx/async.h"
#include "stx/memory.h"
#include "stx/result.h"
#include "stx/scheduler.h"
#include "ashura/utils.h"
#include "stx/scheduler/scheduling/schedule.h"

namespace ash
Expand Down Expand Up @@ -81,7 +81,7 @@ struct ImageLoader : public Subsystem
ASH_CHECK(std::fclose(file) == 0);

stx::Result result = decode_image(
stx::Span{ (u8*) memory.handle, static_cast<usize> (file_size)});
stx::Span{(u8 *) memory.handle, static_cast<usize>(file_size)});

if (result.is_ok())
{
Expand Down
2 changes: 1 addition & 1 deletion ashura/widgets/box.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "ashura/palletes.h"
#include "ashura/primitives.h"
#include "ashura/widget.h"
#include "ashura/utils.h"
#include "ashura/widget.h"
#include "ashura/widgets/image.h"

namespace ash
Expand Down
2 changes: 1 addition & 1 deletion ashura/widgets/grid.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include "ashura/primitives.h"
#include "ashura/widget.h"
#include "ashura/utils.h"
#include "ashura/widget.h"
#include "stx/vec.h"

namespace ash
Expand Down
11 changes: 6 additions & 5 deletions ashura/widgets/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ struct Image : public Widget
f32 aspect_ratio = props.aspect_ratio.value();

Vec2 clipped_extent{std::min(image_extent.height * aspect_ratio,
static_cast<f32>( image_extent.width)),
static_cast<f32>(image_extent.width)),
std::min(image_extent.width / aspect_ratio,
static_cast<f32>( image_extent.height))};
static_cast<f32>(image_extent.height))};

Vec2 original_extent{static_cast<f32>( image_extent.width),
static_cast<f32>( image_extent.height)};
Vec2 original_extent{static_cast<f32>(image_extent.width),
static_cast<f32>(image_extent.height)};

Vec2 space = original_extent - clipped_extent;

Expand Down Expand Up @@ -213,7 +213,8 @@ struct Image : public Widget
if (props.resize_on_load)
{
props.size = Constraint2D::absolute(
static_cast<f32>( buffer.extent.width), static_cast<f32>( buffer.extent.height));
static_cast<f32>(buffer.extent.width),
static_cast<f32>(buffer.extent.height));
}
image_extent = buffer.extent;
}
Expand Down

0 comments on commit 6aa751f

Please sign in to comment.