Skip to content

Commit

Permalink
jump: keep aspect ratio of labels
Browse files Browse the repository at this point in the history
  • Loading branch information
dawsers committed Dec 21, 2024
1 parent e5416f9 commit 3db74fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/decorations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ CBox JumpDecoration::assignedBoxGlobal() {
static auto *const *TEXTSCALE = (Hyprlang::FLOAT *const *)HyprlandAPI::getConfigValue(PHANDLE, "plugin:scroller:jump_labels_scale")->getDataStaticPtr();
CBox box = m_bAssignedGeometry;
box.translate(g_pDecorationPositioner->getEdgeDefinedPoint(DECORATION_EDGE_BOTTOM | DECORATION_EDGE_LEFT | DECORATION_EDGE_RIGHT | DECORATION_EDGE_TOP, m_pWindow.lock()));
if (box.w > box.h) {
box.x += 0.5 * (box.w - box.h);
box.w = box.h;
} else {
box.y += 0.5 * (box.h - box.w);
box.h = box.w;
}

const double scale = **TEXTSCALE < 0.1 ? 0.1 : **TEXTSCALE > 1.0 ? 1.0 : **TEXTSCALE;
box.scaleFromCenter(scale);
Expand Down

0 comments on commit 3db74fc

Please sign in to comment.