changes + more windows bs
This commit is contained in:
@@ -489,10 +489,10 @@ namespace anm2ed::imgui
|
||||
|
||||
auto center_view = [&]() { pan = vec2(); };
|
||||
|
||||
auto fit_view = [&]()
|
||||
{
|
||||
if (animation) set_to_rect(zoom, pan, animation->rect(isRootTransform));
|
||||
};
|
||||
auto fit_view = [&]()
|
||||
{
|
||||
if (animation) set_to_rect(zoom, pan, anm2.animation_rect(*animation, isRootTransform));
|
||||
};
|
||||
|
||||
auto zoom_adjust = [&](float delta)
|
||||
{
|
||||
@@ -628,7 +628,7 @@ namespace anm2ed::imgui
|
||||
savedZoom = zoom;
|
||||
savedPan = pan;
|
||||
|
||||
if (auto rect = document.animation_get()->rect(isRootTransform); rect != vec4(-1.0f))
|
||||
if (auto rect = anm2.animation_rect(*document.animation_get(), isRootTransform); rect != vec4(-1.0f))
|
||||
{
|
||||
size_set(vec2(rect.z, rect.w) * settings.renderScale);
|
||||
set_to_rect(zoom, pan, rect);
|
||||
@@ -798,21 +798,11 @@ namespace anm2ed::imgui
|
||||
auto texSize = vec2(texture.size);
|
||||
if (texSize.x <= 0.0f || texSize.y <= 0.0f) return;
|
||||
|
||||
frame = anm2.frame_effective(id, frame);
|
||||
auto crop = frame.crop;
|
||||
auto size = frame.size;
|
||||
auto pivot = frame.pivot;
|
||||
|
||||
if (frame.regionID != -1)
|
||||
{
|
||||
auto regionIt = spritesheet->regions.find(frame.regionID);
|
||||
if (regionIt != spritesheet->regions.end())
|
||||
{
|
||||
crop = regionIt->second.crop;
|
||||
size = regionIt->second.size;
|
||||
pivot = regionIt->second.pivot;
|
||||
}
|
||||
}
|
||||
|
||||
auto layerModel =
|
||||
math::quad_model_get(size, frame.position, pivot, math::percent_to_unit(frame.scale), frame.rotation);
|
||||
auto layerTransform = sampleTransform * layerModel;
|
||||
|
||||
Reference in New Issue
Block a user