fixed issue with ctrl+click

This commit is contained in:
shweet committed 2026-06-25 00:07:01 -04:00
1 parent b5528bc118
commit f00396bdfe
3 files changed
+23 -19

No files matched your search

+8 -9
View File
@@ -184,7 +184,7 @@ namespace anm2ed
return math::uint8_to_float(value);
}
int color_write(float value) { return math::float_to_uint8(glm::clamp(value, 0.0f, 1.0f)); }
int color_write(float value) { return math::float_to_uint8(value); }
Interpolation interpolation_read(const XMLElement* element, const char* attribute)
{
@@ -1060,7 +1060,6 @@ namespace anm2ed
const std::set<int>& selection)
{
const auto clamp_identity = [](auto value) { return value; };
const auto clamp01 = [](auto value) { return glm::clamp(value, 0.0f, 1.0f); };
const auto clamp_duration = [](int value) { return std::max(FRAME_DURATION_MIN, value); };
if (selection.empty()) return;
@@ -1122,13 +1121,13 @@ namespace anm2ed
apply_scalar(frame->position.y, change.positionY);
apply_scalar(frame->scale.x, change.scaleX);
apply_scalar(frame->scale.y, change.scaleY);
apply_scalar_with_clamp(frame->colorOffset.x, change.colorOffsetR, clamp01);
apply_scalar_with_clamp(frame->colorOffset.y, change.colorOffsetG, clamp01);
apply_scalar_with_clamp(frame->colorOffset.z, change.colorOffsetB, clamp01);
apply_scalar_with_clamp(frame->tint.x, change.tintR, clamp01);
apply_scalar_with_clamp(frame->tint.y, change.tintG, clamp01);
apply_scalar_with_clamp(frame->tint.z, change.tintB, clamp01);
apply_scalar_with_clamp(frame->tint.w, change.tintA, clamp01);
apply_scalar(frame->colorOffset.x, change.colorOffsetR);
apply_scalar(frame->colorOffset.y, change.colorOffsetG);
apply_scalar(frame->colorOffset.z, change.colorOffsetB);
apply_scalar(frame->tint.x, change.tintR);
apply_scalar(frame->tint.y, change.tintG);
apply_scalar(frame->tint.z, change.tintB);
apply_scalar(frame->tint.w, change.tintA);
}
}
+1
View File
@@ -287,6 +287,7 @@ namespace anm2ed::imgui
selection.insert(frameReference);
targetDocument.items.references.insert(itemReference);
}
targetDocument.reference = frameReference;
targetDocument.frame_references_set(std::move(selection));
frames_selection_sync_for(targetDocument);
};
@@ -148,17 +148,17 @@ namespace anm2ed::imgui::wizard
ImGui::PushItemWidth(width);
PROPERTIES_WIDGET(ImGui::DragInt(valueRLabel, &valueAlt.r, DRAG_SPEED, 0, 255, "R:%d"), checkboxRLabel,
PROPERTIES_WIDGET(ImGui::DragInt(valueRLabel, &valueAlt.r, DRAG_SPEED, 0, 0, "R:%d"), checkboxRLabel,
isREnabled);
ImGui::SameLine();
PROPERTIES_WIDGET(ImGui::DragInt(valueGLabel, &valueAlt.g, DRAG_SPEED, 0, 255, "G:%d"), checkboxGLabel,
PROPERTIES_WIDGET(ImGui::DragInt(valueGLabel, &valueAlt.g, DRAG_SPEED, 0, 0, "G:%d"), checkboxGLabel,
isGEnabled);
ImGui::SameLine();
PROPERTIES_WIDGET(ImGui::DragInt(valueBLabel, &valueAlt.b, DRAG_SPEED, 0, 255, "B:%d"), checkboxBLabel,
PROPERTIES_WIDGET(ImGui::DragInt(valueBLabel, &valueAlt.b, DRAG_SPEED, 0, 0, "B:%d"), checkboxBLabel,
isBEnabled);
ImGui::PopItemWidth();
@@ -167,7 +167,9 @@ namespace anm2ed::imgui::wizard
value = vec3(uint8_to_float(valueAlt.r), uint8_to_float(valueAlt.g), uint8_to_float(valueAlt.b));
ImVec4 buttonColor = {isREnabled ? value.r : 0, isGEnabled ? value.g : 0, isBEnabled ? value.b : 0, 1};
ImVec4 buttonColor = {isREnabled ? glm::clamp(value.r, 0.0f, 1.0f) : 0,
isGEnabled ? glm::clamp(value.g, 0.0f, 1.0f) : 0,
isBEnabled ? glm::clamp(value.b, 0.0f, 1.0f) : 0, 1};
ImGui::ColorButton(label, buttonColor);
@@ -190,21 +192,21 @@ namespace anm2ed::imgui::wizard
ImGui::PushItemWidth(width);
PROPERTIES_WIDGET(ImGui::DragInt(valueRLabel, &valueAlt.r, DRAG_SPEED, 0, 255, "R:%d"), checkboxRLabel,
PROPERTIES_WIDGET(ImGui::DragInt(valueRLabel, &valueAlt.r, DRAG_SPEED, 0, 0, "R:%d"), checkboxRLabel,
isREnabled);
ImGui::SameLine();
PROPERTIES_WIDGET(ImGui::DragInt(valueGLabel, &valueAlt.g, DRAG_SPEED, 0, 255, "G:%d"), checkboxGLabel,
PROPERTIES_WIDGET(ImGui::DragInt(valueGLabel, &valueAlt.g, DRAG_SPEED, 0, 0, "G:%d"), checkboxGLabel,
isGEnabled);
ImGui::SameLine();
PROPERTIES_WIDGET(ImGui::DragInt(valueBLabel, &valueAlt.b, DRAG_SPEED, 0, 255, "B:%d"), checkboxBLabel,
PROPERTIES_WIDGET(ImGui::DragInt(valueBLabel, &valueAlt.b, DRAG_SPEED, 0, 0, "B:%d"), checkboxBLabel,
isBEnabled);
ImGui::SameLine();
PROPERTIES_WIDGET(ImGui::DragInt(valueALabel, &valueAlt.a, DRAG_SPEED, 0, 255, "A:%d"), checkboxALabel,
PROPERTIES_WIDGET(ImGui::DragInt(valueALabel, &valueAlt.a, DRAG_SPEED, 0, 0, "A:%d"), checkboxALabel,
isAEnabled);
ImGui::PopItemWidth();
@@ -214,8 +216,10 @@ namespace anm2ed::imgui::wizard
value = vec4(uint8_to_float(valueAlt.r), uint8_to_float(valueAlt.g), uint8_to_float(valueAlt.b),
uint8_to_float(valueAlt.a));
ImVec4 buttonColor = {isREnabled ? value.r : 0, isGEnabled ? value.g : 0, isBEnabled ? value.b : 0,
isAEnabled ? value.a : 1};
ImVec4 buttonColor = {isREnabled ? glm::clamp(value.r, 0.0f, 1.0f) : 0,
isGEnabled ? glm::clamp(value.g, 0.0f, 1.0f) : 0,
isBEnabled ? glm::clamp(value.b, 0.0f, 1.0f) : 0,
isAEnabled ? glm::clamp(value.a, 0.0f, 1.0f) : 1};
ImGui::ColorButton(label, buttonColor);
ImGui::SameLine();