Minsky
minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode Struct Reference
Collaboration diagram for minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode:
Collaboration graph

Public Member Functions

 EnsureEditorMode (PubItem &item)
 
 ~EnsureEditorMode ()
 

Public Attributes

PubItemitem
 
bool editorModeToggled
 
bool variableDisplay =false
 
bool buttonDisplay =false
 
LassoBox origBox
 
float origIWidth
 
float origIHeight
 
double origRotation
 
float stashedZf
 

Detailed Description

Definition at line 35 of file pubTab.cc.

Constructor & Destructor Documentation

◆ EnsureEditorMode()

minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::EnsureEditorMode ( PubItem item)
inline

Definition at line 44 of file pubTab.cc.

References minsky::PubItem::itemRef, schema3::PublicationItem::rotation, schema3::PublicationItem::zoomX, and schema3::PublicationItem::zoomY.

44  :
46  origIWidth(item.itemRef? item.itemRef->iWidth(): 0),
47  origIHeight(item.itemRef? item.itemRef->iHeight(): 0),
48  origRotation(item.itemRef? item.itemRef->rotation(): 0),
49  stashedZf(cminsky().canvas.model->relZoom)
50  {
51  if (!item.itemRef) return;
52  if (auto g=item.itemRef->group.lock())
53  {
54  stashedZf=g->relZoom;
55  g->relZoom=1/g->zoomFactor();
56  }
57  if (auto g=item.itemRef->godleyIconCast())
58  {
59  if ((variableDisplay=g->variableDisplay()))
60  g->toggleVariableDisplay();
61  buttonDisplay=g->editor.drawButtons;
62  g->editor.disableButtons();
63  }
65  item.itemRef->toggleEditorMode();
66 
67  item.itemRef->iWidth(item.zoomX*origIWidth);
68  item.itemRef->iHeight(item.zoomY*origIHeight);
69  item.itemRef->rotation(item.rotation);
70  }
ItemPtr itemRef
Definition: pubTab.h:39
Model model
Definition: canvas.h:103
Canvas canvas
Definition: minsky.h:256
const Minsky & cminsky()
const version to help in const correctness
Definition: minsky.h:549

◆ ~EnsureEditorMode()

minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::~EnsureEditorMode ( )
inline

Definition at line 71 of file pubTab.cc.

References minsky::PubItem::itemRef.

72  {
73  if (!item.itemRef) return;
74  if (auto g=item.itemRef->group.lock())
75  g->relZoom=stashedZf;
76 
78  item.itemRef->toggleEditorMode();
79  if (auto g=item.itemRef->godleyIconCast())
80  {
81  if (variableDisplay)
82  g->toggleVariableDisplay();
83  if (buttonDisplay)
84  g->editor.enableButtons();
85  }
86  item.itemRef->iWidth(origIWidth);
87  item.itemRef->iHeight(origIHeight);
88  item.itemRef->rotation(origRotation);
89  }
ItemPtr itemRef
Definition: pubTab.h:39

Member Data Documentation

◆ buttonDisplay

bool minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::buttonDisplay =false

Definition at line 39 of file pubTab.cc.

◆ editorModeToggled

bool minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::editorModeToggled

Definition at line 38 of file pubTab.cc.

◆ item

PubItem& minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::item

Definition at line 37 of file pubTab.cc.

◆ origBox

LassoBox minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::origBox

Definition at line 40 of file pubTab.cc.

◆ origIHeight

float minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::origIHeight

Definition at line 41 of file pubTab.cc.

◆ origIWidth

float minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::origIWidth

Definition at line 41 of file pubTab.cc.

◆ origRotation

double minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::origRotation

Definition at line 42 of file pubTab.cc.

◆ stashedZf

float minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::stashedZf

Definition at line 43 of file pubTab.cc.

◆ variableDisplay

bool minsky::anonymous_namespace{pubTab.cc}::EnsureEditorMode::variableDisplay =false

Definition at line 39 of file pubTab.cc.


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