mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2024-11-24 03:05:58 +01:00
hyprtrails,borders-plus-plus: chase hyprland
This commit is contained in:
parent
db46f6acb3
commit
61656eb7d6
3 changed files with 14 additions and 14 deletions
|
@ -28,14 +28,14 @@ class CBordersPlusPlus : public IHyprWindowDecoration {
|
||||||
virtual std::string getDisplayName();
|
virtual std::string getDisplayName();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SWindowDecorationExtents m_seExtents;
|
SBoxExtents m_seExtents;
|
||||||
|
|
||||||
PHLWINDOWREF m_pWindow;
|
PHLWINDOWREF m_pWindow;
|
||||||
|
|
||||||
CBox m_bLastRelativeBox;
|
CBox m_bLastRelativeBox;
|
||||||
|
|
||||||
Vector2D m_vLastWindowPos;
|
Vector2D m_vLastWindowPos;
|
||||||
Vector2D m_vLastWindowSize;
|
Vector2D m_vLastWindowSize;
|
||||||
|
|
||||||
double m_fLastThickness = 0;
|
double m_fLastThickness = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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};
|
CBox monbox = {0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y};
|
||||||
|
|
||||||
float matrix[9];
|
float matrix[9];
|
||||||
wlr_matrix_project_box(matrix, monbox.pWlr(), wlr_output_transform_invert(WL_OUTPUT_TRANSFORM_NORMAL), 0,
|
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
|
g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix.data()); // TODO: write own, don't use WLR here
|
||||||
|
|
||||||
float glMatrix[9];
|
float glMatrix[9];
|
||||||
wlr_matrix_multiply(glMatrix, g_pHyprOpenGL->m_RenderData.projection, matrix);
|
wlr_matrix_multiply(glMatrix, g_pHyprOpenGL->m_RenderData.projection, matrix);
|
||||||
|
@ -249,8 +249,8 @@ void CTrail::draw(CMonitor* pMonitor, float a) {
|
||||||
glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
|
glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
|
||||||
|
|
||||||
CBox transformedBox = monbox;
|
CBox transformedBox = monbox;
|
||||||
transformedBox.transform(wlr_output_transform_invert(g_pHyprOpenGL->m_RenderData.pMonitor->transform), g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x,
|
transformedBox.transform(wlTransformToHyprutils(wlr_output_transform_invert(g_pHyprOpenGL->m_RenderData.pMonitor->transform)),
|
||||||
g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y);
|
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());
|
glVertexAttribPointer(g_pGlobalState->trailShader.posAttrib, 2, GL_FLOAT, GL_FALSE, 0, (float*)points.data());
|
||||||
|
|
||||||
|
@ -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),
|
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};
|
(int)(m_vLastWindowSize.x + m_seExtents.topLeft.x + m_seExtents.bottomRight.x), (int)m_seExtents.topLeft.y};
|
||||||
g_pHyprRenderer->damageBox(&dm);
|
g_pHyprRenderer->damageBox(&dm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ class CTrail : public IHyprWindowDecoration {
|
||||||
|
|
||||||
int m_iTimer = 0;
|
int m_iTimer = 0;
|
||||||
|
|
||||||
SWindowDecorationExtents m_seExtents;
|
SBoxExtents m_seExtents;
|
||||||
|
|
||||||
PHLWINDOWREF m_pWindow;
|
PHLWINDOWREF m_pWindow;
|
||||||
|
|
||||||
|
@ -62,4 +62,4 @@ class CTrail : public IHyprWindowDecoration {
|
||||||
|
|
||||||
CBox m_bLastBox = {0};
|
CBox m_bLastBox = {0};
|
||||||
bool m_bNeedsDamage = false;
|
bool m_bNeedsDamage = false;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue