KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::AUTOMATIC_FIT Class Reference

What the last zoom to fit showed, so a canvas that changes size can fit it again. More...

#include <automatic_fit.h>

Public Member Functions

void Record (const BOX2I &aBox, std::optional< double > aMarginScale, double aScale, const VECTOR2D &aCenter)
 Note a fit of aBox that left the view at aScale and aCenter.
 
void Clear ()
 
bool Holds (double aScale, const VECTOR2D &aCenter) const
 True while a view at aScale and aCenter shows exactly what the last fit left.
 
const BOX2I & GetBox () const
 
std::optional< double > GetMarginScale () const
 

Private Attributes

bool m_valid = false
 
BOX2I m_box
 
std::optional< double > m_marginScale
 
double m_scale = 0.0
 
VECTOR2D m_center
 

Detailed Description

What the last zoom to fit showed, so a canvas that changes size can fit it again.

The view counts as still at its automatic fit while its scale and centre are exactly those the fit left. Any zoom or pan, by the user or by a tool, changes one of them and so ends it without having to be reported here.

Definition at line 38 of file automatic_fit.h.

Member Function Documentation

◆ Clear()

void KIGFX::AUTOMATIC_FIT::Clear ( )
inline

Definition at line 51 of file automatic_fit.h.

References m_valid.

◆ GetBox()

const BOX2I & KIGFX::AUTOMATIC_FIT::GetBox ( ) const
inline

Definition at line 59 of file automatic_fit.h.

References m_box.

◆ GetMarginScale()

std::optional< double > KIGFX::AUTOMATIC_FIT::GetMarginScale ( ) const
inline

Definition at line 61 of file automatic_fit.h.

References m_marginScale.

◆ Holds()

bool KIGFX::AUTOMATIC_FIT::Holds ( double aScale,
const VECTOR2D & aCenter ) const
inline

True while a view at aScale and aCenter shows exactly what the last fit left.

Definition at line 54 of file automatic_fit.h.

References m_center, m_scale, and m_valid.

◆ Record()

void KIGFX::AUTOMATIC_FIT::Record ( const BOX2I & aBox,
std::optional< double > aMarginScale,
double aScale,
const VECTOR2D & aCenter )
inline

Note a fit of aBox that left the view at aScale and aCenter.

Definition at line 42 of file automatic_fit.h.

References m_box, m_center, m_marginScale, m_scale, and m_valid.

Member Data Documentation

◆ m_box

BOX2I KIGFX::AUTOMATIC_FIT::m_box
private

Definition at line 65 of file automatic_fit.h.

Referenced by GetBox(), and Record().

◆ m_center

VECTOR2D KIGFX::AUTOMATIC_FIT::m_center
private

Definition at line 68 of file automatic_fit.h.

Referenced by Holds(), and Record().

◆ m_marginScale

std::optional<double> KIGFX::AUTOMATIC_FIT::m_marginScale
private

Definition at line 66 of file automatic_fit.h.

Referenced by GetMarginScale(), and Record().

◆ m_scale

double KIGFX::AUTOMATIC_FIT::m_scale = 0.0
private

Definition at line 67 of file automatic_fit.h.

Referenced by Holds(), and Record().

◆ m_valid

bool KIGFX::AUTOMATIC_FIT::m_valid = false
private

Definition at line 64 of file automatic_fit.h.

Referenced by Clear(), Holds(), and Record().


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