[nostalgia/core/studio] Add zoom support to TileSheetEditor
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
|
||||
namespace nostalgia::core {
|
||||
|
||||
void TileSheetGrid::setPixelSizeMod(float sm) noexcept {
|
||||
m_pixelSizeMod = sm;
|
||||
}
|
||||
|
||||
ox::Error TileSheetGrid::buildShader() noexcept {
|
||||
const auto pixelLineVshad = ox::sfmt(VShad, glutils::GlslVersion);
|
||||
const auto pixelLineFshad = ox::sfmt(FShad, glutils::GlslVersion);
|
||||
@@ -92,11 +96,11 @@ void TileSheetGrid::setBufferObjects(const NostalgiaGraphic &img, glutils::Buffe
|
||||
}
|
||||
}
|
||||
|
||||
ImVec2 TileSheetGrid::pixelSize() noexcept {
|
||||
ImVec2 TileSheetGrid::pixelSize() const noexcept {
|
||||
const auto [sw, sh] = ImGui::GetContentRegionAvail();
|
||||
constexpr float ymod = 0.35f / 10.0f;
|
||||
const auto xmod = ymod * sh / sw;
|
||||
return {xmod, ymod};
|
||||
return {xmod * m_pixelSizeMod, ymod * m_pixelSizeMod};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user