format documents
This commit is contained in:
@@ -51,7 +51,7 @@ PD_API void Button::Draw() {
|
||||
// io->Ren->OnScreen(screen);
|
||||
list->PathRect(FinalPos(), FinalPos() + size, io->FrameRounding);
|
||||
list->PathFill(io->Theme.Get(color));
|
||||
// list->LayerUp();
|
||||
// list->LayerUp();
|
||||
list->DrawText(FinalPos() + size * 0.5 - tdim * 0.5, label.c_str(),
|
||||
io->Theme.Get(UI7Color_Text));
|
||||
// list->LayerDown();
|
||||
|
||||
@@ -33,8 +33,7 @@ PD_API void ColorEdit::HandleInput() {
|
||||
}
|
||||
// Assert(screen.get(), "Screen is not set up!");
|
||||
// if (screen->ScreenType() == Screen::Bottom) {
|
||||
if (io->InputHandler.DragObject(this->GetID() + 2,
|
||||
fvec4(FinalPos(), size))) {
|
||||
if (io->InputHandler.DragObject(this->GetID() + 2, fvec4(FinalPos(), size))) {
|
||||
if (io->InputHandler.DragReleasedAW) {
|
||||
is_shown = !is_shown;
|
||||
}
|
||||
@@ -55,17 +54,16 @@ PD_API void ColorEdit::Draw() {
|
||||
}
|
||||
layout->SetPosition(FinalPos());
|
||||
layout->AddObjectEx(
|
||||
new DynObj(
|
||||
[=, this](UI7::IO* io, Li::Drawlist* l, Container* thiz) {
|
||||
thiz->SetSize(layout->GetSize());
|
||||
// l->Layer(30);
|
||||
l->PathRect(thiz->GetPos(), thiz->GetPos() + thiz->GetSize(),
|
||||
io->FrameRounding);
|
||||
l->PathFill(io->Theme.Get(UI7Color_FrameBackground));
|
||||
}),
|
||||
new DynObj([=, this](UI7::IO* io, Li::Drawlist* l, Container* thiz) {
|
||||
thiz->SetSize(layout->GetSize());
|
||||
// l->Layer(30);
|
||||
l->PathRect(thiz->GetPos(), thiz->GetPos() + thiz->GetSize(),
|
||||
io->FrameRounding);
|
||||
l->PathFill(io->Theme.Get(UI7Color_FrameBackground));
|
||||
}),
|
||||
UI7LytAdd_Front | UI7LytAdd_NoCursorUpdate | UI7LytAdd_NoScrollHandle);
|
||||
auto obj = new DynObj(
|
||||
[=, this](UI7::IO* io, Li::Drawlist* l, Container* thiz) {
|
||||
auto obj =
|
||||
new DynObj([=, this](UI7::IO* io, Li::Drawlist* l, Container* thiz) {
|
||||
l->PathRect(thiz->FinalPos(), thiz->FinalPos() + io->ItemRowHeight,
|
||||
io->FrameRounding);
|
||||
l->PathFill(*color_ref);
|
||||
|
||||
@@ -31,10 +31,10 @@ PD_API void Container::HandleScrolling(fvec2 scrolling, fvec4 viewport) {
|
||||
}
|
||||
last_use = PD::Os::GetTime();
|
||||
pos -= fvec2(0, scrolling.y);
|
||||
skippable = !Li::Math::InBounds(
|
||||
pos, size,
|
||||
fvec4(viewport.x, viewport.y, viewport.x + viewport.z,
|
||||
viewport.y + viewport.w));
|
||||
skippable =
|
||||
!Li::Math::InBounds(pos, size,
|
||||
fvec4(viewport.x, viewport.y, viewport.x + viewport.z,
|
||||
viewport.y + viewport.w));
|
||||
}
|
||||
|
||||
PD_API void Container::HandleInternalInput() {
|
||||
|
||||
@@ -21,10 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <pd/ui7/container/dragdata.hpp>
|
||||
#include <pd/ui7/container/label.hpp>
|
||||
#include <type_traits>
|
||||
#include <algorithm>
|
||||
|
||||
namespace PD {
|
||||
namespace UI7 {
|
||||
@@ -93,8 +93,8 @@ PD_API void DragData<T>::Draw() {
|
||||
// list->LayerDown();
|
||||
off_x += td.x + io->ItemSpace.x + io->FramePadding.x;
|
||||
}
|
||||
list->DrawText(FinalPos() + fvec2(off_x, io->FramePadding.y * 0.5), label.c_str(),
|
||||
io->Theme.Get(UI7Color_Text));
|
||||
list->DrawText(FinalPos() + fvec2(off_x, io->FramePadding.y * 0.5),
|
||||
label.c_str(), io->Theme.Get(UI7Color_Text));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -33,7 +33,7 @@ PD_API void Image::Draw() {
|
||||
list->BindTexture(img);
|
||||
list->DrawRectFilled(FinalPos(), newsize, 0xffffffff);
|
||||
list->UnbindTexture();
|
||||
//list->LayerDown();
|
||||
// list->LayerDown();
|
||||
}
|
||||
} // namespace UI7
|
||||
} // namespace PD
|
||||
@@ -21,10 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <pd/ui7/container/label.hpp>
|
||||
#include <pd/ui7/container/slider.hpp>
|
||||
#include <type_traits>
|
||||
#include <algorithm>
|
||||
|
||||
namespace PD {
|
||||
namespace UI7 {
|
||||
@@ -57,9 +57,9 @@ PD_API void Slider<T>::HandleInput() {
|
||||
fvec4(FinalPos() + fvec2(2, 0), fvec2(width, GetSize().y)))) {
|
||||
if (!io->InputHandler.DragReleasedAW) {
|
||||
*data = std::clamp(
|
||||
T(max * (std::clamp(io->InputHandler.DragLastPosition.x - xps, 0.f,
|
||||
width) /
|
||||
width)),
|
||||
T(max *
|
||||
(std::clamp(io->InputHandler.DragLastPosition.x - xps, 0.f, width) /
|
||||
width)),
|
||||
this->min, this->max);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user