fix issues on Windows

This commit is contained in:
2022-08-27 21:07:33 -07:00
parent 36f95c0c08
commit 1163ee23eb
2 changed files with 13 additions and 7 deletions

View File

@@ -277,9 +277,9 @@ bool Timeline::BeginItem(Item item, uint64_t begin, uint64_t end) noexcept {
ImGui::SetItemAllowOverlap();
HandleGrip(item, resizer_w, kMove, kMoveDone, ImGuiMouseCursor_Hand);
const auto pad = ImGui::GetStyle().WindowPadding / 2;
ImGui::SetCursorPosY(pad.y);
ImGui::Indent(pad.x);
const auto wpad = ImGui::GetStyle().WindowPadding / 2;
ImGui::SetCursorPosY(wpad.y);
ImGui::Indent(wpad.x);
}
return shown;
}

View File

@@ -8,11 +8,17 @@ extern "C" {
namespace nf7 {
void NativeFile::Init() {
DWORD acc = 0;
if (flags_ & kRead) acc |= GENERIC_READ;
if (flags_ & kWrite) acc |= GENERIC_WRITE;
DWORD acc = 0;
DWORD flags = 0;
if (flags_ & kRead) {
acc |= GENERIC_READ;
flags |= OPEN_EXISTING;
}
if (flags_ & kWrite) {
acc |= GENERIC_WRITE;
flags |= OPEN_ALWAYS;
}
DWORD flags = OPEN_ALWAYS;
HANDLE h = CreateFileA(
path_.string().c_str(),