Skip to content

Commit

Permalink
hyprtrails,borders-plus-plus: chase hyprland
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Jun 23, 2024
1 parent db46f6a commit 61656eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions borders-plus-plus/borderDeco.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ class CBordersPlusPlus : public IHyprWindowDecoration {
virtual std::string getDisplayName();

private:
SWindowDecorationExtents m_seExtents;
SBoxExtents m_seExtents;

PHLWINDOWREF m_pWindow;
PHLWINDOWREF m_pWindow;

CBox m_bLastRelativeBox;
CBox m_bLastRelativeBox;

Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize;
Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize;

double m_fLastThickness = 0;
};
double m_fLastThickness = 0;
};
10 changes: 5 additions & 5 deletions hyprtrails/trail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ void CTrail::draw(CMonitor* pMonitor, float a) {
CBox monbox = {0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y};

float matrix[9];
wlr_matrix_project_box(matrix, monbox.pWlr(), wlr_output_transform_invert(WL_OUTPUT_TRANSFORM_NORMAL), 0,
g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix.data()); // TODO: write own, don't use WLR here
projectBox(matrix, monbox, wlTransformToHyprutils(wlr_output_transform_invert(WL_OUTPUT_TRANSFORM_NORMAL)), 0,
g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix.data()); // TODO: write own, don't use WLR here

float glMatrix[9];
wlr_matrix_multiply(glMatrix, g_pHyprOpenGL->m_RenderData.projection, matrix);
Expand Down Expand Up @@ -249,8 +249,8 @@ void CTrail::draw(CMonitor* pMonitor, float a) {
glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a);

CBox transformedBox = monbox;
transformedBox.transform(wlr_output_transform_invert(g_pHyprOpenGL->m_RenderData.pMonitor->transform), g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x,
g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y);
transformedBox.transform(wlTransformToHyprutils(wlr_output_transform_invert(g_pHyprOpenGL->m_RenderData.pMonitor->transform)),
g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y);

glVertexAttribPointer(g_pGlobalState->trailShader.posAttrib, 2, GL_FLOAT, GL_FALSE, 0, (float*)points.data());

Expand Down Expand Up @@ -334,4 +334,4 @@ void CTrail::damageEntire() {
CBox dm = {(int)(m_vLastWindowPos.x - m_seExtents.topLeft.x), (int)(m_vLastWindowPos.y - m_seExtents.topLeft.y),
(int)(m_vLastWindowSize.x + m_seExtents.topLeft.x + m_seExtents.bottomRight.x), (int)m_seExtents.topLeft.y};
g_pHyprRenderer->damageBox(&dm);
}
}
4 changes: 2 additions & 2 deletions hyprtrails/trail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CTrail : public IHyprWindowDecoration {

int m_iTimer = 0;

SWindowDecorationExtents m_seExtents;
SBoxExtents m_seExtents;

PHLWINDOWREF m_pWindow;

Expand All @@ -62,4 +62,4 @@ class CTrail : public IHyprWindowDecoration {

CBox m_bLastBox = {0};
bool m_bNeedsDamage = false;
};
};

0 comments on commit 61656eb

Please sign in to comment.