An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 8a0cf2b9 authored by David Thompson's avatar David Thompson
Browse files

Layout vertical annotations top-to-bottom.

... so that the left-to-right and top-to-bottom orders match.
Without this change, the reading order of annotations does
not satisfy the Priniple of Minimum Astonishment (at least
for scripts with left-right and top-bottom transitivity; it's
unclear whether Hebrew, Japanese, Chinese, or Arabic readers
will feel good about this change -- among others).

Change-Id: I05f6705d77cb3c8181deba92ab56ff31a12bc77c
parent 134134a7
......@@ -838,11 +838,11 @@ int vtkScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
for ( i = 0; i < numNotes; ++ i )
{
x[0] = swatchC0;
x[1] = barY + i * delta + swatchPad;
x[1] = barY + barHeight - i * delta - swatchPad;
pts->SetPoint( 4 * i, x );
x[0] = swatchC1;
pts->SetPoint( 4 * i + 1, x );
x[1] += delta - swatchPad * 2;
x[1] -= delta - swatchPad * 2;
pts->SetPoint( 4 * i + 2, x );
x[0] = swatchC0;
pts->SetPoint( 4 * i + 3, x );
......@@ -1220,18 +1220,18 @@ int vtkScalarBarActor::LayoutAnnotationsVertically(
#define VTK_ANN_VLAYOUT(j,dir,delt) \
ctr = barY + delta * ( j + 0.5 ); \
ll[0] = lpts->InsertNextPoint( xl0, ctr, 0. ); \
this->AnnotationLabels[j]->GetBoundingBox( bds ); \
this->AnnotationLabels[numNotes - j - 1]->GetBoundingBox( bds ); \
hh = ( bds[3] - bds[2] + pad ) / 2.; /* label half-height, including padding */ \
if ( ( dir < 0 && ctr + hh > dnCum ) || ( dir > 0 && ctr - hh < upCum ) ) \
ctr = delt + dir * hh; \
this->AnnotationLabels[j]->GetTextProperty()->SetJustification( \
this->AnnotationLabels[numNotes - j - 1]->GetTextProperty()->SetJustification( \
this->TextPosition == PrecedeScalarBar ? VTK_TEXT_LEFT : VTK_TEXT_RIGHT ); \
this->AnnotationLabels[j]->GetTextProperty()->SetVerticalJustification( VTK_TEXT_CENTERED ); \
this->AnnotationLabels[j]->SetPosition( \
this->AnnotationLabels[numNotes - j - 1]->GetTextProperty()->SetVerticalJustification( VTK_TEXT_CENTERED ); \
this->AnnotationLabels[numNotes - j - 1]->SetPosition( \
barX + ( this->TextPosition == PrecedeScalarBar ? +1 : -1 ) * ( pad + this->AnnotationLeaderPadding ), \
ctr ); \
ll[1] = lpts->InsertNextPoint( xl1, ctr, 0. ); \
if ( ! this->LookupTable->GetAnnotation( j ).empty() ) \
if ( ! this->LookupTable->GetAnnotation( numNotes - j - 1 ).empty() ) \
{ \
llines->InsertNextCell( 2, ll ); \
} \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment