Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
b25ced1a
Commit
b25ced1a
authored
Aug 28, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed 'use zoom and rotation settings when exporting';
Fixed: enabled was not used for default symbol in symbol font;
parent
a240ba1e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
13 deletions
+33
-13
src/data/format/image.cpp
src/data/format/image.cpp
+20
-6
src/data/symbol_font.cpp
src/data/symbol_font.cpp
+1
-1
src/gui/control/gallery_list.cpp
src/gui/control/gallery_list.cpp
+7
-0
src/gui/set/stats_panel.cpp
src/gui/set/stats_panel.cpp
+1
-1
src/render/card/viewer.cpp
src/render/card/viewer.cpp
+3
-4
src/script/script_manager.cpp
src/script/script_manager.cpp
+1
-1
No files found.
src/data/format/image.cpp
View file @
b25ced1a
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include <data/format/formats.hpp>
#include <data/format/formats.hpp>
#include <data/set.hpp>
#include <data/set.hpp>
#include <data/stylesheet.hpp>
#include <data/settings.hpp>
#include <data/settings.hpp>
#include <render/card/viewer.hpp>
#include <render/card/viewer.hpp>
...
@@ -19,17 +20,30 @@ void export_image(const SetP& set, const CardP& card, const String& filename) {
...
@@ -19,17 +20,30 @@ void export_image(const SetP& set, const CardP& card, const String& filename) {
// but image.saveFile determines it automagicly
// but image.saveFile determines it automagicly
}
}
class
UnzoomedDataViewer
:
public
DataViewer
{
public:
UnzoomedDataViewer
(
bool
use_zoom_settings
)
:
use_zoom_settings
(
use_zoom_settings
)
{}
virtual
Rotation
getRotation
()
const
;
private:
bool
use_zoom_settings
;
};
Rotation
UnzoomedDataViewer
::
getRotation
()
const
{
if
(
use_zoom_settings
)
{
return
DataViewer
::
getRotation
();
}
else
{
if
(
!
stylesheet
)
stylesheet
=
set
->
stylesheet
;
return
Rotation
(
0
,
stylesheet
->
getCardRect
(),
1.0
,
1.0
,
true
);
}
}
Bitmap
export_bitmap
(
const
SetP
&
set
,
const
CardP
&
card
)
{
Bitmap
export_bitmap
(
const
SetP
&
set
,
const
CardP
&
card
)
{
// create viewer
// create viewer
DataViewer
viewer
;
UnzoomedDataViewer
viewer
(
!
settings
.
stylesheetSettingsFor
(
set
->
stylesheetFor
(
card
)).
card_normal_export
())
;
viewer
.
setSet
(
set
);
viewer
.
setSet
(
set
);
viewer
.
setCard
(
card
);
viewer
.
setCard
(
card
);
// size of cards
// size of cards
if
(
settings
.
stylesheetSettingsFor
(
set
->
stylesheetFor
(
card
)).
card_normal_export
())
{
// TODO
// viewer.rotation.angle = 0;
// viewer.rotation.zoom = 1.0;
}
RealSize
size
=
viewer
.
getRotation
().
getExternalSize
();
RealSize
size
=
viewer
.
getRotation
().
getExternalSize
();
// create bitmap & dc
// create bitmap & dc
Bitmap
bitmap
((
int
)
size
.
width
,
(
int
)
size
.
height
);
Bitmap
bitmap
((
int
)
size
.
width
,
(
int
)
size
.
height
);
...
...
src/data/symbol_font.cpp
View file @
b25ced1a
...
@@ -217,7 +217,7 @@ next_symbol:;
...
@@ -217,7 +217,7 @@ next_symbol:;
SymbolInFont
*
SymbolFont
::
defaultSymbol
()
const
{
SymbolInFont
*
SymbolFont
::
defaultSymbol
()
const
{
FOR_EACH_CONST
(
sym
,
symbols
)
{
FOR_EACH_CONST
(
sym
,
symbols
)
{
if
(
sym
->
code
.
empty
())
return
sym
.
get
();
if
(
sym
->
code
.
empty
()
&&
sym
->
enabled
)
return
sym
.
get
();
}
}
return
nullptr
;
return
nullptr
;
}
}
...
...
src/gui/control/gallery_list.cpp
View file @
b25ced1a
...
@@ -115,6 +115,13 @@ void GalleryList::onChar(wxKeyEvent& ev) {
...
@@ -115,6 +115,13 @@ void GalleryList::onChar(wxKeyEvent& ev) {
update
();
update
();
sendEvent
(
EVENT_GALLERY_SELECT
);
sendEvent
(
EVENT_GALLERY_SELECT
);
}
break
;
}
break
;
case
WXK_TAB
:
{
// send a navigation event to our parent, to select another control
// we need this because tabs are not handled on the set window panels
wxNavigationKeyEvent
nev
;
nev
.
SetDirection
(
!
ev
.
ShiftDown
());
GetParent
()
->
ProcessEvent
(
nev
);
}
break
;
}
}
}
}
...
...
src/gui/set/stats_panel.cpp
View file @
b25ced1a
...
@@ -97,7 +97,7 @@ void StatCategoryList::drawItem(DC& dc, int x, int y, size_t item, bool selected
...
@@ -97,7 +97,7 @@ void StatCategoryList::drawItem(DC& dc, int x, int y, size_t item, bool selected
// ----------------------------------------------------------------------------- : StatsPanel
// ----------------------------------------------------------------------------- : StatsPanel
StatsPanel
::
StatsPanel
(
Window
*
parent
,
int
id
)
StatsPanel
::
StatsPanel
(
Window
*
parent
,
int
id
)
:
SetWindowPanel
(
parent
,
id
)
:
SetWindowPanel
(
parent
,
id
,
true
)
,
up_to_date
(
true
),
active
(
false
)
,
up_to_date
(
true
),
active
(
false
)
{
{
// init controls
// init controls
...
...
src/render/card/viewer.cpp
View file @
b25ced1a
...
@@ -29,9 +29,8 @@ DataViewer::~DataViewer() {}
...
@@ -29,9 +29,8 @@ DataViewer::~DataViewer() {}
void
DataViewer
::
draw
(
DC
&
dc
)
{
void
DataViewer
::
draw
(
DC
&
dc
)
{
StyleSheetSettings
&
ss
=
settings
.
stylesheetSettingsFor
(
*
stylesheet
);
StyleSheetSettings
&
ss
=
settings
.
stylesheetSettingsFor
(
*
stylesheet
);
RotatedDC
rdc
(
dc
,
ss
.
card_angle
(),
stylesheet
->
getCardRect
(),
ss
.
card_zoom
(),
RotatedDC
rdc
(
dc
,
getRotation
(),
nativeLook
()
?
QUALITY_LOW
:
(
ss
.
card_anti_alias
()
?
QUALITY_AA
:
QUALITY_SUB_PIXEL
),
nativeLook
()
?
QUALITY_LOW
:
(
ss
.
card_anti_alias
()
?
QUALITY_AA
:
QUALITY_SUB_PIXEL
));
true
);
draw
(
rdc
,
stylesheet
->
card_background
);
draw
(
rdc
,
stylesheet
->
card_background
);
}
}
void
DataViewer
::
draw
(
RotatedDC
&
dc
,
const
Color
&
background
)
{
void
DataViewer
::
draw
(
RotatedDC
&
dc
,
const
Color
&
background
)
{
...
@@ -105,7 +104,7 @@ Context& DataViewer::getContext() const { return set->getContext(card); }
...
@@ -105,7 +104,7 @@ Context& DataViewer::getContext() const { return set->getContext(card); }
Rotation
DataViewer
::
getRotation
()
const
{
Rotation
DataViewer
::
getRotation
()
const
{
if
(
!
stylesheet
)
stylesheet
=
set
->
stylesheet
;
if
(
!
stylesheet
)
stylesheet
=
set
->
stylesheet
;
StyleSheetSettings
&
ss
=
settings
.
stylesheetSettingsFor
(
*
stylesheet
);
StyleSheetSettings
&
ss
=
settings
.
stylesheetSettingsFor
(
*
stylesheet
);
return
Rotation
(
ss
.
card_angle
(),
stylesheet
->
getCardRect
(),
ss
.
card_zoom
(),
true
);
return
Rotation
(
ss
.
card_angle
(),
stylesheet
->
getCardRect
(),
ss
.
card_zoom
(),
1.0
,
true
);
}
}
// ----------------------------------------------------------------------------- : Setting data
// ----------------------------------------------------------------------------- : Setting data
...
...
src/script/script_manager.cpp
View file @
b25ced1a
...
@@ -78,7 +78,7 @@ Context& SetScriptContext::getContext(const CardP& card) {
...
@@ -78,7 +78,7 @@ Context& SetScriptContext::getContext(const CardP& card) {
ctx
.
setVariable
(
_
(
"card"
),
to_script
(
card
));
ctx
.
setVariable
(
_
(
"card"
),
to_script
(
card
));
ctx
.
setVariable
(
_
(
"styling"
),
to_script
(
&
set
.
stylingDataFor
(
card
)));
ctx
.
setVariable
(
_
(
"styling"
),
to_script
(
&
set
.
stylingDataFor
(
card
)));
}
else
{
}
else
{
ctx
.
setVariable
(
_
(
"card"
),
ScriptValueP
()
);
ctx
.
setVariable
(
_
(
"card"
),
script_nil
);
ctx
.
setVariable
(
_
(
"styling"
),
to_script
(
&
set
.
stylingDataFor
(
*
stylesheet
)));
ctx
.
setVariable
(
_
(
"styling"
),
to_script
(
&
set
.
stylingDataFor
(
*
stylesheet
)));
}
}
return
ctx
;
return
ctx
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment