Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
GertyP committed Nov 14, 2023
1 parent 0769933 commit 31331e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions qrenderdoc/Styles/RDStyle/RDStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ QRect RDStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
else if(cc == QStyle::CC_Slider)
{
QRect ret = opt->rect;
ret.adjust(4,1,-4,-1);
ret.adjust(4, 1, -4, -1);
if(sc == QStyle::SC_SliderGroove)
{
int halfHeightLessMargin = ret.height() / 2 - 2;
Expand All @@ -483,7 +483,8 @@ QRect RDStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
{
ret.adjust(0, 2, 0, -2);
const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(widget);
qreal posUNorm = (qreal)(slider->sliderPosition() - slider->minimum()) / (qreal)(slider->maximum() - slider->minimum());
qreal posUNorm = (qreal)(slider->sliderPosition() - slider->minimum()) /
(qreal)(slider->maximum() - slider->minimum());
int sliderX = ret.left() + posUNorm * ret.width();
ret.setLeft(sliderX - 3);
ret.setRight(sliderX + 3);
Expand Down Expand Up @@ -1141,8 +1142,8 @@ void RDStyle::drawComplexControl(ComplexControl control, const QStyleOptionCompl
else if(control == QStyle::CC_Slider)
{
QRect grooveRect = subControlRect(control, opt, QStyle::SC_SliderGroove, widget);
p->drawLine(QLine(grooveRect.x(), grooveRect.y() + grooveRect.height() / 2,
grooveRect.right(), grooveRect.y() + grooveRect.height() / 2));
p->drawLine(QLine(grooveRect.x(), grooveRect.y() + grooveRect.height() / 2, grooveRect.right(),
grooveRect.y() + grooveRect.height() / 2));

QRect handleRect = subControlRect(control, opt, QStyle::SC_SliderHandle, widget);
QBrush sliderBrush = opt->palette.brush(QPalette::Dark);
Expand Down
5 changes: 3 additions & 2 deletions qrenderdoc/Windows/BufferViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5798,8 +5798,9 @@ void BufferViewer::on_vtxExploderSlider_valueChanged(int value)

void BufferViewer::on_vtxExploderSlider_sliderReleased()
{
//Always snaps back to zero
QAbstractSlider *slider = ui->controlsToolbar->findChild<QAbstractSlider*>(QStringLiteral("vtxExploderSlider"));
// Always snaps back to zero
QAbstractSlider *slider =
ui->controlsToolbar->findChild<QAbstractSlider *>(QStringLiteral("vtxExploderSlider"));
slider->setSliderPosition(0);
}

Expand Down
3 changes: 2 additions & 1 deletion renderdoc/data/glsl/mesh.vert
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@

vec3 vtxExploder(vec3 pos, int vid)
{
float nonLinearVtxExplodeScale = 8.0f * Mesh.vtxExploderSNorm * Mesh.vtxExploderSNorm * Mesh.vtxExploderSNorm;
float nonLinearVtxExplodeScale =
8.0f * Mesh.vtxExploderSNorm * Mesh.vtxExploderSNorm * Mesh.vtxExploderSNorm;
vec3 explodeDir = normalize(pos);

float displacement = nonLinearVtxExplodeScale * ((float((vid >> 1) & 0xf) / 15.0f) * 1.5f - 0.5f);
Expand Down

0 comments on commit 31331e3

Please sign in to comment.