Squashed 'deps/nostalgia/' changes from 976550ef..430cae16
430cae16 [nostalgia,studio] Update for new ImGui's Mac awareness git-subtree-dir: deps/nostalgia git-subtree-split: 430cae1622d807a6a04925183646d3ee7401b76a
This commit is contained in:
@ -202,7 +202,7 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key key, bool down) {
|
||||
void TileSheetEditorImGui::draw(studio::StudioContext&) noexcept {
|
||||
auto const popupOpen = m_subsheetEditor.isOpen() || m_exportMenu.isOpen();
|
||||
if (!popupOpen && m_tool == TileSheetTool::Select) {
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_ModCtrl)) {
|
||||
if (ImGui::IsKeyDown(ImGuiKey_ModCtrl)) {
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_A)) {
|
||||
auto const&img = m_model.activeSubSheet();
|
||||
m_model.setSelection({{}, {img.columns * TileWidth, img.rows * TileHeight}});
|
||||
@ -408,19 +408,17 @@ void TileSheetEditorImGui::drawTileSheet(ox::Vec2 const&fbSize) noexcept {
|
||||
ImVec2(1, 0));
|
||||
// handle input, this must come after drawing
|
||||
auto const&io = ImGui::GetIO();
|
||||
auto const mousePos = ox::Vec2(io.MousePos);
|
||||
auto const mousePos = ox::Vec2(ImGui::GetMousePos());
|
||||
if (ImGui::IsItemHovered()) {
|
||||
auto const wheel = io.MouseWheel;
|
||||
auto const wheelh = io.MouseWheelH;
|
||||
if (wheel != 0) {
|
||||
const auto zoomMod = ox::defines::OS == ox::OS::Darwin ?
|
||||
io.KeySuper : turbine::buttonDown(m_tctx, turbine::Key::Mod_Ctrl);
|
||||
m_view.scrollV(fbSize, wheel, zoomMod);
|
||||
m_view.scrollV(fbSize, wheel, ImGui::IsKeyDown(ImGuiKey_ModCtrl));
|
||||
}
|
||||
if (wheelh != 0) {
|
||||
m_view.scrollH(fbSize, wheelh);
|
||||
}
|
||||
if (io.MouseDown[0] && m_prevMouseDownPos != mousePos) {
|
||||
if (ImGui::IsMouseDown(0) && m_prevMouseDownPos != mousePos) {
|
||||
m_prevMouseDownPos = mousePos;
|
||||
switch (m_tool) {
|
||||
case TileSheetTool::Draw:
|
||||
|
Reference in New Issue
Block a user