-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Move Aspect Ratio control to a floating button + Use a shared aspec…
…t ratio for View Constraint and Export Size
- Loading branch information
1 parent
99e899f
commit 89c7e9c
Showing
7 changed files
with
57 additions
and
35 deletions.
There are no files selected for viewing
Submodule Cool
updated
11 files
+12 −16 | src/Cool/Exporter/ExportSize.cpp | |
+8 −8 | src/Cool/Exporter/ExportSize.h | |
+2 −3 | src/Cool/Exporter/Exporter.h | |
+0 −11 | src/Cool/Exporter/ExporterGui.cpp | |
+3 −4 | src/Cool/Exporter/ExporterGui.h | |
+22 −4 | src/Cool/Image/AspectRatio.cpp | |
+16 −32 | src/Cool/Image/ImageSizeConstraint.cpp | |
+11 −32 | src/Cool/Image/ImageSizeConstraint.h | |
+23 −0 | src/Cool/Image/SharedAspectRatio.hpp | |
+8 −1 | src/Cool/View/View.cpp | |
+1 −0 | src/Cool/View/View.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,17 +24,14 @@ static constexpr bool has_openssl = | |
false; | ||
#endif | ||
|
||
void GalleryPoster::imgui_open_sharing_form(std::optional<Cool::AspectRatio> const& aspect_ratio) | ||
void GalleryPoster::imgui_open_sharing_form() | ||
{ | ||
Cool::ImGuiExtras::disabled_if( | ||
!has_openssl, | ||
"DEV ONLY: We didn't find the OpenSSL library on your machine while compiling Coollab so this feature was disabled.\nLook at how to install OpenSSL on your computer if you want this feature.", [&]() { | ||
"DEV ONLY: We didn't find the OpenSSL library on your machine while compiling Coollab so this feature was disabled.\nLook at how to install OpenSSL on your computer if you want this feature.", | ||
[&]() { | ||
if (ImGui::Button(Cool::icon_fmt("Share online", ICOMOON_EARTH, true).c_str())) | ||
{ | ||
_window.open(); | ||
if (aspect_ratio) | ||
_aspect_ratio = *aspect_ratio; | ||
} | ||
} | ||
); | ||
} | ||
|
@@ -46,7 +43,7 @@ void GalleryPoster::imgui_window(std::function<std::string(img::Size)> const& re | |
Cool::ImGuiExtras::markdown("If you want to edit or remove it, send an email at [[email protected]](mailto:[email protected]) from the email address that you will provide below."); | ||
Cool::ImGuiExtras::separator_text("Artwork"); | ||
_artwork_info.imgui(); | ||
_aspect_ratio.imgui(0.f, "Aspect Ratio"); | ||
_shared_aspect_ratio->aspect_ratio.imgui(0.f, "Aspect Ratio"); | ||
{ | ||
auto const size = export_size(); | ||
auto sz = glm::ivec2{ | ||
|
@@ -82,7 +79,7 @@ void GalleryPoster::imgui_window(std::function<std::string(img::Size)> const& re | |
|
||
auto GalleryPoster::export_size() const -> img::Size | ||
{ | ||
return Cool::compute_image_size(_aspect_ratio.get(), 2'250'000.f); | ||
return Cool::compute_image_size(_shared_aspect_ratio->aspect_ratio.get(), 2'250'000.f); | ||
} | ||
|
||
} // namespace Lab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters