Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::Text::Layout::InfiniteScanlineMaker Class Reference

private to Layout. More...

#include <Layout-TNG-Scanline-Maker.h>

Inheritance diagram for Inkscape::Text::Layout::InfiniteScanlineMaker:
Inkscape::Text::Layout::ScanlineMaker

Public Member Functions

 InfiniteScanlineMaker (double initial_x, double initial_y, Layout::Direction block_progression)
 
 ~InfiniteScanlineMaker () override
 
std::vector< ScanRunmakeScanline (Layout::FontMetrics const &line_height) override
 Returns a single infinite run at the current location.
 
void completeLine () override
 Increments the current y by the current line height.
 
double yCoordinate () override
 Returns the y coordinate of the top of the scanline that will be returned by the next call to makeScanline().
 
void setNewYCoordinate (double new_y) override
 Just changes y.
 
bool canExtendCurrentScanline (Layout::FontMetrics const &line_height) override
 Always true, but has to save the new height.
 
void setLineHeight (Layout::FontMetrics const &line_height) override
 Sets current line block height.
 
- Public Member Functions inherited from Inkscape::Text::Layout::ScanlineMaker
virtual ~ScanlineMaker ()=default
 

Private Attributes

double _x
 
double _y
 
Layout::FontMetrics _current_line_height
 
bool _negative_block_progression
 

Detailed Description

private to Layout.

Generates infinite scanlines for when you don't want wrapping

This is a 'fake' scanline maker which will always return infinite results, effectively turning off wrapping. It's a very simple implementation.

It does have the curious property, however, that the input coordinates are 'real' x and y, but the outputs are rotated according to the block_progression.

Definition at line 93 of file Layout-TNG-Scanline-Maker.h.

Constructor & Destructor Documentation

◆ InfiniteScanlineMaker()

Inkscape::Text::Layout::InfiniteScanlineMaker::InfiniteScanlineMaker ( double  initial_x,
double  initial_y,
Layout::Direction  block_progression 
)

◆ ~InfiniteScanlineMaker()

Inkscape::Text::Layout::InfiniteScanlineMaker::~InfiniteScanlineMaker ( )
overridedefault

Member Function Documentation

◆ canExtendCurrentScanline()

bool Inkscape::Text::Layout::InfiniteScanlineMaker::canExtendCurrentScanline ( Layout::FontMetrics const &  line_height)
overridevirtual

Always true, but has to save the new height.

Implements Inkscape::Text::Layout::ScanlineMaker.

Definition at line 67 of file Layout-TNG-Scanline-Makers.cpp.

◆ completeLine()

void Inkscape::Text::Layout::InfiniteScanlineMaker::completeLine ( )
overridevirtual

Increments the current y by the current line height.

Implements Inkscape::Text::Layout::ScanlineMaker.

Definition at line 53 of file Layout-TNG-Scanline-Makers.cpp.

References Inkscape::Text::Layout::FontMetrics::emSize().

◆ makeScanline()

std::vector< Layout::ScanlineMaker::ScanRun > Inkscape::Text::Layout::InfiniteScanlineMaker::makeScanline ( Layout::FontMetrics const &  line_height)
overridevirtual

Returns a single infinite run at the current location.

Implements Inkscape::Text::Layout::ScanlineMaker.

Definition at line 43 of file Layout-TNG-Scanline-Makers.cpp.

References _x.

◆ setLineHeight()

void Inkscape::Text::Layout::InfiniteScanlineMaker::setLineHeight ( Layout::FontMetrics const &  line_height)
overridevirtual

Sets current line block height.

Call before completeLine() to correct for actually used line height (in case some chunks with larger font-size rolled back).

Implements Inkscape::Text::Layout::ScanlineMaker.

Definition at line 73 of file Layout-TNG-Scanline-Makers.cpp.

◆ setNewYCoordinate()

void Inkscape::Text::Layout::InfiniteScanlineMaker::setNewYCoordinate ( double  new_y)
overridevirtual

Just changes y.

Implements Inkscape::Text::Layout::ScanlineMaker.

Definition at line 62 of file Layout-TNG-Scanline-Makers.cpp.

◆ yCoordinate()

double Inkscape::Text::Layout::InfiniteScanlineMaker::yCoordinate ( )
inlineoverridevirtual

Returns the y coordinate of the top of the scanline that will be returned by the next call to makeScanline().

Implements Inkscape::Text::Layout::ScanlineMaker.

Definition at line 105 of file Layout-TNG-Scanline-Maker.h.

References _y.

Member Data Documentation

◆ _current_line_height

Layout::FontMetrics Inkscape::Text::Layout::InfiniteScanlineMaker::_current_line_height
private

Definition at line 120 of file Layout-TNG-Scanline-Maker.h.

Referenced by InfiniteScanlineMaker().

◆ _negative_block_progression

bool Inkscape::Text::Layout::InfiniteScanlineMaker::_negative_block_progression
private

Definition at line 121 of file Layout-TNG-Scanline-Maker.h.

Referenced by InfiniteScanlineMaker().

◆ _x

double Inkscape::Text::Layout::InfiniteScanlineMaker::_x
private

Definition at line 119 of file Layout-TNG-Scanline-Maker.h.

Referenced by InfiniteScanlineMaker().

◆ _y

double Inkscape::Text::Layout::InfiniteScanlineMaker::_y
private

Definition at line 119 of file Layout-TNG-Scanline-Maker.h.

Referenced by InfiniteScanlineMaker(), and yCoordinate().


The documentation for this class was generated from the following files: