Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed Oct 15, 2024
1 parent 003ec0c commit cf2c21d
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 15 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ endif()
if(NOT CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
if(WIN32)
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>DLL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
endif()
if(APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
Expand All @@ -45,6 +47,7 @@ enable_testing()

find_package(Imath)
find_package(Freetype)
find_package(lunasvg)
find_package(ZLIB)
find_package(PNG)
find_package(JPEG)
Expand Down
2 changes: 1 addition & 1 deletion bin/toucan-view/ClipItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace toucan
event.render->drawText(
_draw.glyphs,
_size.fontMetrics,
dtk::V2F(g3.min.x, g3.min.y + g3.h() / 2 - _size.fontMetrics.lineHeight / 2),
dtk::V2I(g3.min.x, g3.min.y + g3.h() / 2 - _size.fontMetrics.lineHeight / 2),
event.style->getColorRole(dtk::ColorRole::Text));
}
}
2 changes: 1 addition & 1 deletion bin/toucan-view/GapItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ namespace toucan
event.render->drawText(
_draw.glyphs,
_size.fontMetrics,
dtk::V2F(g3.min.x, g3.min.y + g3.h() / 2 - _size.fontMetrics.lineHeight / 2),
dtk::V2I(g3.min.x, g3.min.y + g3.h() / 2 - _size.fontMetrics.lineHeight / 2),
event.style->getColorRole(dtk::ColorRole::Text));
}
}
2 changes: 1 addition & 1 deletion bin/toucan-view/TimelineItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ namespace toucan

int pos = timeToPos(_currentTime);
event.render->drawRect(
dtk::Box2F(pos, g.min.y + _size.scrollPos.y, _size.border * 2, g.h()),
dtk::Box2I(pos, g.min.y + _size.scrollPos.y, _size.border * 2, g.h()),
event.style->getColorRole(dtk::ColorRole::Red));

std::string s = _timeUnitsModel->getLabel(_currentTime);
Expand Down
2 changes: 1 addition & 1 deletion bin/toucan-view/TrackItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace toucan
parent);

_track = track;
_text = !track->name().empty() ? track->name() : track->kind();
_text = !track->name().empty() ? track->name() : (track->kind() + " Track");
_color = OTIO_NS::Track::Kind::video == track->kind() ?
dtk::Color4F(.2F, .2F, .3F) :
dtk::Color4F(.2F, .3F, .2F);
Expand Down
2 changes: 1 addition & 1 deletion bin/toucan-view/Viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace toucan
options.imageFilters.magnify = dtk::ImageFilter::Nearest;
event.render->drawImage(
_image,
dtk::Box2F(0, 0, imageSize.w, imageSize.h),
dtk::Box2I(0, 0, imageSize.w, imageSize.h),
dtk::Color4F(1.F, 1.F, 1.F),
options);
event.render->setTransform(m);
Expand Down
4 changes: 3 additions & 1 deletion cmake/SuperBuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ endif()
if(NOT CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
if(WIN32)
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>DLL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
endif()
if(APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
Expand Down
10 changes: 5 additions & 5 deletions data/CompositeTracks.otio
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"value": 0
}
},
"name": "Blue"
"name": "Blue Clip"
},
{
"OTIO_SCHEMA": "Clip.1",
Expand Down Expand Up @@ -82,11 +82,11 @@
"value": 0
}
},
"name": "Green"
"name": "Green Clip"
}
],
"kind": "Video",
"name": "Video"
"name": "Video Track"
},
{
"OTIO_SCHEMA": "Track.1",
Expand Down Expand Up @@ -130,11 +130,11 @@
"value": 0
}
},
"name": "Counter"
"name": "Counter Clip"
}
],
"kind": "Video",
"name": "Video"
"name": "Video Track"
}
],
"name": "Stack"
Expand Down
2 changes: 1 addition & 1 deletion lib/toucanEdit/ClipWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace toucan
event.render->drawText(
_draw.glyphs,
_size.fontMetrics,
dtk::V2F(g3.min.x, g3.min.y + g3.h() / 2 - _size.fontMetrics.lineHeight / 2),
dtk::V2I(g3.min.x, g3.min.y + g3.h() / 2 - _size.fontMetrics.lineHeight / 2),
event.style->getColorRole(dtk::ColorRole::Text));
}
}
2 changes: 1 addition & 1 deletion lib/toucanEdit/GapWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace toucan
event.render->drawText(
_draw.glyphs,
_size.fontMetrics,
dtk::V2F(g3.min.x, g3.min.y + g3.h() / 2 - _size.fontMetrics.lineHeight / 2),
dtk::V2I(g3.min.x, g3.min.y + g3.h() / 2 - _size.fontMetrics.lineHeight / 2),
event.style->getColorRole(dtk::ColorRole::Text));
}
}
2 changes: 1 addition & 1 deletion lib/toucanEdit/TimelineWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ namespace toucan

int pos = timeToPos(_currentTime);
event.render->drawRect(
dtk::Box2F(pos, g.min.y + _size.scrollPos.y, _size.border * 2, g.h()),
dtk::Box2I(pos, g.min.y + _size.scrollPos.y, _size.border * 2, g.h()),
event.style->getColorRole(dtk::ColorRole::Red));

std::string s = _timeUnitsModel->getLabel(_currentTime);
Expand Down

0 comments on commit cf2c21d

Please sign in to comment.