Skip to content
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

Closed
wants to merge 15 commits into from
Closed

Add QskArcShadowNode #3

wants to merge 15 commits into from

Conversation

rick-vogel
Copy link
Owner

@rick-vogel rick-vogel commented Dec 4, 2023

Recording 2023-12-09 at 16 19 40 image

upstream: uwerat#350

@rick-vogel rick-vogel marked this pull request as draft December 4, 2023 16:34

namespace
{
struct QskArcShadowMaterialProperties
Copy link
Owner Author

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

qreal extend = 16.0; //< pixel >= 0.0
};

class QskArcShadowMaterial final : public QSGSimpleMaterialShader<QskArcShadowMaterialProperties>
Copy link
Owner Author

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

auto& state = *material->state();
state.color = color;
state.rect = r;
state.radius = 1.0 - (metrics.thickness() + extend / 4) / size;
Copy link
Owner Author

@rick-vogel rick-vogel Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • TODO magic number

return;
}

const auto path = metrics.painterPath( arcRect );

if ( true /* TODO */ )
Copy link
Owner Author

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

QskSGNode::setNodeRole( shadowNode, ShadowRole );
}

const auto extend = 16.0;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • TODO add metric

return;
}

const auto path = metrics.painterPath( arcRect );

if ( shadowColor.alpha() > 0.0 )
Copy link
Owner Author

@rick-vogel rick-vogel Dec 9, 2023

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

@rick-vogel rick-vogel closed this Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant