-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add QskArcShadowNode #3
Conversation
src/nodes/QskArcNode.cpp
Outdated
|
||
namespace | ||
{ | ||
struct QskArcShadowMaterialProperties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- complete documentation of valua ranges
src/nodes/QskArcNode.cpp
Outdated
qreal extend = 16.0; //< pixel >= 0.0 | ||
}; | ||
|
||
class QskArcShadowMaterial final : public QSGSimpleMaterialShader<QskArcShadowMaterialProperties> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- use QSG classes and prepare for Qt6 RHI
src/nodes/QskArcNode.cpp
Outdated
auto& state = *material->state(); | ||
state.color = color; | ||
state.rect = r; | ||
state.radius = 1.0 - (metrics.thickness() + extend / 4) / size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- TODO magic number
src/nodes/QskArcNode.cpp
Outdated
return; | ||
} | ||
|
||
const auto path = metrics.painterPath( arcRect ); | ||
|
||
if ( true /* TODO */ ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- TODO add shadow node condition
src/nodes/QskArcNode.cpp
Outdated
QskSGNode::setNodeRole( shadowNode, ShadowRole ); | ||
} | ||
|
||
const auto extend = 16.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- TODO add metric
src/nodes/QskArcNode.cpp
Outdated
return; | ||
} | ||
|
||
const auto path = metrics.painterPath( arcRect ); | ||
|
||
if ( shadowColor.alpha() > 0.0 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uwerat One could argue that if the gradient and stroke aren't visible the shadow is also not visible
upstream: uwerat#350