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
d5e3a027
Commit
d5e3a027
authored
Apr 06, 2008
by
coppro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More warnings/minor fixes
parent
fcb54c05
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
48 additions
and
45 deletions
+48
-45
src/data/action/symbol.cpp
src/data/action/symbol.cpp
+1
-1
src/data/action/value.hpp
src/data/action/value.hpp
+1
-1
src/data/field.cpp
src/data/field.cpp
+2
-2
src/data/field/choice.cpp
src/data/field/choice.cpp
+4
-3
src/data/font.cpp
src/data/font.cpp
+1
-1
src/data/installer.cpp
src/data/installer.cpp
+7
-5
src/data/settings.cpp
src/data/settings.cpp
+1
-1
src/gfx/blend_image.cpp
src/gfx/blend_image.cpp
+1
-1
src/gfx/generated_image.cpp
src/gfx/generated_image.cpp
+1
-1
src/gfx/image_effects.cpp
src/gfx/image_effects.cpp
+2
-2
src/gfx/resample_text.cpp
src/gfx/resample_text.cpp
+2
-2
src/gui/control/card_viewer.cpp
src/gui/control/card_viewer.cpp
+1
-1
src/gui/control/tree_list.cpp
src/gui/control/tree_list.cpp
+1
-1
src/gui/print_window.cpp
src/gui/print_window.cpp
+5
-5
src/gui/symbol/symmetry_editor.cpp
src/gui/symbol/symmetry_editor.cpp
+3
-3
src/gui/value/package_choice.cpp
src/gui/value/package_choice.cpp
+1
-1
src/render/symbol/viewer.cpp
src/render/symbol/viewer.cpp
+4
-4
src/render/text/viewer.cpp
src/render/text/viewer.cpp
+1
-1
src/render/value/symbol.cpp
src/render/value/symbol.cpp
+2
-2
src/util/io/package.cpp
src/util/io/package.cpp
+1
-1
src/util/io/reader.cpp
src/util/io/reader.cpp
+4
-4
src/util/reflect.hpp
src/util/reflect.hpp
+1
-1
src/util/rotation.cpp
src/util/rotation.cpp
+1
-1
No files found.
src/data/action/symbol.cpp
View file @
d5e3a027
...
@@ -328,7 +328,7 @@ void CombiningModeAction::perform(bool to_undo) {
...
@@ -328,7 +328,7 @@ void CombiningModeAction::perform(bool to_undo) {
SymbolPartNameAction
::
SymbolPartNameAction
(
const
SymbolPartP
&
part
,
const
String
&
name
,
size_t
old_cursor
,
size_t
new_cursor
)
SymbolPartNameAction
::
SymbolPartNameAction
(
const
SymbolPartP
&
part
,
const
String
&
name
,
size_t
old_cursor
,
size_t
new_cursor
)
:
part
(
part
),
part_name
(
name
)
:
part
(
part
),
part_name
(
name
)
,
new_cursor
(
old_cursor
),
old_cursor
(
new
_cursor
)
// will be swapped
,
old_cursor
(
new_cursor
),
new_cursor
(
old
_cursor
)
// will be swapped
{}
{}
String
SymbolPartNameAction
::
getName
(
bool
to_undo
)
const
{
String
SymbolPartNameAction
::
getName
(
bool
to_undo
)
const
{
...
...
src/data/action/value.hpp
View file @
d5e3a027
...
@@ -35,7 +35,7 @@ DECLARE_POINTER_TYPE(PackageChoiceValue);
...
@@ -35,7 +35,7 @@ DECLARE_POINTER_TYPE(PackageChoiceValue);
/// An Action the changes a Value
/// An Action the changes a Value
class
ValueAction
:
public
Action
{
class
ValueAction
:
public
Action
{
public:
public:
inline
ValueAction
(
const
Card
*
card
,
const
ValueP
&
value
)
:
card
(
card
),
valueP
(
value
)
{}
inline
ValueAction
(
const
Card
*
card
,
const
ValueP
&
value
)
:
valueP
(
value
),
card
(
card
)
{}
virtual
String
getName
(
bool
to_undo
)
const
;
virtual
String
getName
(
bool
to_undo
)
const
;
...
...
src/data/field.cpp
View file @
d5e3a027
...
@@ -161,11 +161,11 @@ int Style::update(Context& ctx) {
...
@@ -161,11 +161,11 @@ int Style::update(Context& ctx) {
if
(
automatic_side
&
AUTO_LEFT
)
left
=
right
-
width
;
if
(
automatic_side
&
AUTO_LEFT
)
left
=
right
-
width
;
else
if
(
automatic_side
&
AUTO_WIDTH
)
width
=
right
-
left
;
else
if
(
automatic_side
&
AUTO_WIDTH
)
width
=
right
-
left
;
else
if
(
automatic_side
&
AUTO_RIGHT
)
right
=
left
+
width
;
else
if
(
automatic_side
&
AUTO_RIGHT
)
right
=
left
+
width
;
else
{
int
lr
=
left
+
right
;
left
=
(
lr
-
width
)
/
2
;
right
=
(
lr
+
width
)
/
2
;
}
else
{
int
lr
=
int
(
left
+
right
)
;
left
=
(
lr
-
width
)
/
2
;
right
=
(
lr
+
width
)
/
2
;
}
if
(
automatic_side
&
AUTO_TOP
)
top
=
bottom
-
height
;
if
(
automatic_side
&
AUTO_TOP
)
top
=
bottom
-
height
;
else
if
(
automatic_side
&
AUTO_HEIGHT
)
height
=
bottom
-
top
;
else
if
(
automatic_side
&
AUTO_HEIGHT
)
height
=
bottom
-
top
;
else
if
(
automatic_side
&
AUTO_BOTTOM
)
bottom
=
top
+
height
;
else
if
(
automatic_side
&
AUTO_BOTTOM
)
bottom
=
top
+
height
;
else
{
int
tb
=
top
+
bottom
;
top
=
(
tb
-
height
)
/
2
;
bottom
=
(
tb
+
height
)
/
2
;
}
else
{
int
tb
=
int
(
top
+
bottom
)
;
top
=
(
tb
-
height
)
/
2
;
bottom
=
(
tb
+
height
)
/
2
;
}
// adjust rotation point
// adjust rotation point
if
(
angle
!=
0
&&
(
automatic_side
&
(
AUTO_LEFT
|
AUTO_TOP
)))
{
if
(
angle
!=
0
&&
(
automatic_side
&
(
AUTO_LEFT
|
AUTO_TOP
)))
{
double
s
=
sin
(
angle
*
M_PI
/
180
),
c
=
cos
(
angle
*
M_PI
/
180
);
double
s
=
sin
(
angle
*
M_PI
/
180
),
c
=
cos
(
angle
*
M_PI
/
180
);
...
...
src/data/field/choice.cpp
View file @
d5e3a027
...
@@ -46,12 +46,13 @@ IMPLEMENT_REFLECTION(ChoiceField) {
...
@@ -46,12 +46,13 @@ IMPLEMENT_REFLECTION(ChoiceField) {
// ----------------------------------------------------------------------------- : ChoiceField::Choice
// ----------------------------------------------------------------------------- : ChoiceField::Choice
ChoiceField
::
Choice
::
Choice
()
ChoiceField
::
Choice
::
Choice
()
:
first_id
(
0
)
:
line_below
(
false
),
enabled
(
true
),
type
(
CHOICE_TYPE_CHECK
)
,
line_below
(
false
),
enabled
(
true
),
type
(
CHOICE_TYPE_CHECK
)
,
first_id
(
0
)
{}
{}
ChoiceField
::
Choice
::
Choice
(
const
String
&
name
)
ChoiceField
::
Choice
::
Choice
(
const
String
&
name
)
:
name
(
name
)
,
first_id
(
0
)
:
name
(
name
)
,
line_below
(
false
),
enabled
(
true
),
type
(
CHOICE_TYPE_CHECK
)
,
line_below
(
false
),
enabled
(
true
),
type
(
CHOICE_TYPE_CHECK
)
,
first_id
(
0
)
{}
{}
...
...
src/data/font.cpp
View file @
d5e3a027
...
@@ -88,7 +88,7 @@ wxFont Font::toWxFont(double scale) const {
...
@@ -88,7 +88,7 @@ wxFont Font::toWxFont(double scale) const {
}
}
}
else
if
(
name
().
empty
())
{
}
else
if
(
name
().
empty
())
{
font
=
*
wxNORMAL_FONT
;
font
=
*
wxNORMAL_FONT
;
font
.
SetPointSize
(
size
>
1
?
size_i
:
scale
*
font
.
GetPointSize
(
));
font
.
SetPointSize
(
size
>
1
?
size_i
:
int
(
scale
*
font
.
GetPointSize
()
));
return
font
;
return
font
;
}
else
if
(
flags
&
FONT_ITALIC
&&
!
italic_name
().
empty
())
{
}
else
if
(
flags
&
FONT_ITALIC
&&
!
italic_name
().
empty
())
{
font
=
wxFont
(
size_i
,
wxFONTFAMILY_DEFAULT
,
wxFONTSTYLE_NORMAL
,
weight_i
,
underline
(),
italic_name
());
font
=
wxFont
(
size_i
,
wxFONTFAMILY_DEFAULT
,
wxFONTSTYLE_NORMAL
,
weight_i
,
underline
(),
italic_name
());
...
...
src/data/installer.cpp
View file @
d5e3a027
...
@@ -38,7 +38,7 @@ IMPLEMENT_REFLECTION(Installer) {
...
@@ -38,7 +38,7 @@ IMPLEMENT_REFLECTION(Installer) {
REFLECT
(
packages
);
REFLECT
(
packages
);
}
}
/*
#if 0
// ----------------------------------------------------------------------------- : Installing
// ----------------------------------------------------------------------------- : Installing
void Installer::installFrom(const String& filename, bool message_on_success, bool local) {
void Installer::installFrom(const String& filename, bool message_on_success, bool local) {
...
@@ -135,12 +135,14 @@ void Installer::install(bool local, bool check_dependencies) {
...
@@ -135,12 +135,14 @@ void Installer::install(bool local, bool check_dependencies) {
}
}
os.Write(*is);
os.Write(*is);
}
}
*
/
*/
}
}
void Installer::install(const String& package) {
void Installer::install(const String& package) {
// TODO
// TODO
}*/
}
#endif
// ----------------------------------------------------------------------------- : Creating
// ----------------------------------------------------------------------------- : Creating
...
@@ -255,14 +257,14 @@ DownloadableInstaller::~DownloadableInstaller() {
...
@@ -255,14 +257,14 @@ DownloadableInstaller::~DownloadableInstaller() {
InstallablePackage
::
InstallablePackage
(
const
PackageVersionP
&
installed
,
const
PackageDescriptionP
&
description
)
InstallablePackage
::
InstallablePackage
(
const
PackageVersionP
&
installed
,
const
PackageDescriptionP
&
description
)
:
installed
(
installed
)
:
installed
(
installed
)
,
description
(
description
)
,
description
(
description
)
,
action
(
PACKAGE_NOTHING
)
,
status
(
PACKAGE_INSTALLED
)
,
status
(
PACKAGE_INSTALLED
)
,
action
(
PACKAGE_NOTHING
)
{}
{}
InstallablePackage
::
InstallablePackage
(
const
PackageDescriptionP
&
description
,
const
DownloadableInstallerP
&
installer
)
InstallablePackage
::
InstallablePackage
(
const
PackageDescriptionP
&
description
,
const
DownloadableInstallerP
&
installer
)
:
description
(
description
)
:
description
(
description
)
,
installer
(
installer
)
,
installer
(
installer
)
,
action
(
PACKAGE_NOTHING
)
,
status
(
PACKAGE_INSTALLABLE
)
,
status
(
PACKAGE_INSTALLABLE
)
,
action
(
PACKAGE_NOTHING
)
{}
{}
void
InstallablePackage
::
determineStatus
()
{
void
InstallablePackage
::
determineStatus
()
{
...
...
src/data/settings.cpp
View file @
d5e3a027
...
@@ -157,8 +157,8 @@ Settings::Settings()
...
@@ -157,8 +157,8 @@ Settings::Settings()
,
installer_list_url
(
_
(
"http://magicseteditor.sourceforge.net/installers"
))
,
installer_list_url
(
_
(
"http://magicseteditor.sourceforge.net/installers"
))
,
check_updates
(
CHECK_IF_CONNECTED
)
,
check_updates
(
CHECK_IF_CONNECTED
)
,
check_updates_all
(
true
)
,
check_updates_all
(
true
)
,
install_type
(
INSTALL_DEFAULT
)
,
website_url
(
_
(
"http://magicseteditor.sourceforge.net/"
))
,
website_url
(
_
(
"http://magicseteditor.sourceforge.net/"
))
,
install_type
(
INSTALL_DEFAULT
)
{}
{}
void
Settings
::
addRecentFile
(
const
String
&
filename
)
{
void
Settings
::
addRecentFile
(
const
String
&
filename
)
{
...
...
src/gfx/blend_image.cpp
View file @
d5e3a027
...
@@ -107,7 +107,7 @@ void set_alpha(Image& img, Byte* al, const wxSize& alpha_size) {
...
@@ -107,7 +107,7 @@ void set_alpha(Image& img, Byte* al, const wxSize& alpha_size) {
}
}
void
set_alpha
(
Image
&
img
,
double
alpha
)
{
void
set_alpha
(
Image
&
img
,
double
alpha
)
{
Byte
b_alpha
=
alpha
*
255
;
Byte
b_alpha
=
Byte
(
alpha
*
255
)
;
if
(
!
img
.
HasAlpha
())
{
if
(
!
img
.
HasAlpha
())
{
img
.
InitAlpha
();
img
.
InitAlpha
();
memset
(
img
.
GetAlpha
(),
b_alpha
,
img
.
GetWidth
()
*
img
.
GetHeight
());
memset
(
img
.
GetAlpha
(),
b_alpha
,
img
.
GetWidth
()
*
img
.
GetHeight
());
...
...
src/gfx/generated_image.cpp
View file @
d5e3a027
...
@@ -31,7 +31,7 @@ Image conform_image(const Image& img, const GeneratedImage::Options& options) {
...
@@ -31,7 +31,7 @@ Image conform_image(const Image& img, const GeneratedImage::Options& options) {
if
((
iw
==
options
.
width
&&
ih
==
options
.
height
)
||
(
options
.
width
==
0
&&
options
.
height
==
0
))
{
if
((
iw
==
options
.
width
&&
ih
==
options
.
height
)
||
(
options
.
width
==
0
&&
options
.
height
==
0
))
{
// zoom?
// zoom?
if
(
options
.
zoom
!=
1.0
)
{
if
(
options
.
zoom
!=
1.0
)
{
image
=
resample
(
image
,
i
w
*
options
.
zoom
,
ih
*
options
.
zoom
);
image
=
resample
(
image
,
i
nt
(
iw
*
options
.
zoom
),
int
(
ih
*
options
.
zoom
)
);
}
else
{
}
else
{
// already the right size
// already the right size
}
}
...
...
src/gfx/image_effects.cpp
View file @
d5e3a027
...
@@ -18,7 +18,7 @@ void saturate(Image& image, double amount) {
...
@@ -18,7 +18,7 @@ void saturate(Image& image, double amount) {
Byte
*
end
=
pix
+
image
.
GetWidth
()
*
image
.
GetHeight
()
*
3
;
Byte
*
end
=
pix
+
image
.
GetWidth
()
*
image
.
GetHeight
()
*
3
;
if
(
amount
>
0
)
{
if
(
amount
>
0
)
{
amount
=
min
(
amount
,
0.99
);
amount
=
min
(
amount
,
0.99
);
int
factor
=
256
*
amount
;
int
factor
=
int
(
256
*
amount
)
;
int
div
=
768
-
3
*
factor
;
int
div
=
768
-
3
*
factor
;
while
(
pix
!=
end
)
{
while
(
pix
!=
end
)
{
int
r
=
pix
[
0
],
g
=
pix
[
1
],
b
=
pix
[
2
];
int
r
=
pix
[
0
],
g
=
pix
[
1
],
b
=
pix
[
2
];
...
@@ -35,7 +35,7 @@ void saturate(Image& image, double amount) {
...
@@ -35,7 +35,7 @@ void saturate(Image& image, double amount) {
pix
+=
3
;
pix
+=
3
;
}
}
}
else
{
}
else
{
int
factor1
=
256
*
-
amount
;
int
factor1
=
int
(
256
*
-
amount
)
;
int
factor2
=
768
-
3
*
factor1
;
int
factor2
=
768
-
3
*
factor1
;
while
(
pix
!=
end
)
{
while
(
pix
!=
end
)
{
int
r
=
pix
[
0
],
g
=
pix
[
1
],
b
=
pix
[
2
];
int
r
=
pix
[
0
],
g
=
pix
[
1
],
b
=
pix
[
2
];
...
...
src/gfx/resample_text.cpp
View file @
d5e3a027
...
@@ -185,8 +185,8 @@ void draw_resampled_text(DC& dc, const RealPoint& pos, const RealRect& rect, dou
...
@@ -185,8 +185,8 @@ void draw_resampled_text(DC& dc, const RealPoint& pos, const RealRect& rect, dou
// get image
// get image
mdc
.
SelectObject
(
wxNullBitmap
);
mdc
.
SelectObject
(
wxNullBitmap
);
// step 2. sample down
// step 2. sample down
if
(
!
sideways
(
angle
))
w
*=
stretch
;
if
(
!
sideways
(
angle
))
w
=
int
(
w
*
stretch
);
// GCC makes annoying conversion warnings if *= is used here.
else
h
*=
stretch
;
else
h
=
int
(
h
*
stretch
)
;
Image
img_small
(
w
,
h
,
false
);
Image
img_small
(
w
,
h
,
false
);
fill_image
(
img_small
,
dc
.
GetTextForeground
());
fill_image
(
img_small
,
dc
.
GetTextForeground
());
downsample_to_alpha
(
buffer
,
img_small
);
downsample_to_alpha
(
buffer
,
img_small
);
...
...
src/gui/control/card_viewer.cpp
View file @
d5e3a027
...
@@ -29,7 +29,7 @@ wxSize CardViewer::DoGetBestSize() const {
...
@@ -29,7 +29,7 @@ wxSize CardViewer::DoGetBestSize() const {
if
(
set
)
{
if
(
set
)
{
if
(
!
stylesheet
)
stylesheet
=
set
->
stylesheet
;
if
(
!
stylesheet
)
stylesheet
=
set
->
stylesheet
;
StyleSheetSettings
&
ss
=
settings
.
stylesheetSettingsFor
(
*
stylesheet
);
StyleSheetSettings
&
ss
=
settings
.
stylesheetSettingsFor
(
*
stylesheet
);
wxSize
size
(
stylesheet
->
card_width
*
ss
.
card_zoom
(),
stylesheet
->
card_height
*
ss
.
card_zoom
(
));
wxSize
size
(
int
(
stylesheet
->
card_width
*
ss
.
card_zoom
()),
int
(
stylesheet
->
card_height
*
ss
.
card_zoom
()
));
if
(
sideways
(
ss
.
card_angle
()))
swap
(
size
.
x
,
size
.
y
);
if
(
sideways
(
ss
.
card_angle
()))
swap
(
size
.
x
,
size
.
y
);
return
size
+
ws
-
cs
;
return
size
+
ws
-
cs
;
}
}
...
...
src/gui/control/tree_list.cpp
View file @
d5e3a027
...
@@ -116,9 +116,9 @@ size_t TreeList::findParent(size_t start) const {
...
@@ -116,9 +116,9 @@ size_t TreeList::findParent(size_t start) const {
TreeList
::
TreeList
(
Window
*
parent
,
int
id
,
long
style
)
TreeList
::
TreeList
(
Window
*
parent
,
int
id
,
long
style
)
:
wxPanel
(
parent
,
id
,
wxDefaultPosition
,
wxDefaultSize
,
style
|
wxWANTS_CHARS
|
wxVSCROLL
)
:
wxPanel
(
parent
,
id
,
wxDefaultPosition
,
wxDefaultSize
,
style
|
wxWANTS_CHARS
|
wxVSCROLL
)
,
selection
(
NOTHING
)
,
total_lines
(
0
)
,
total_lines
(
0
)
,
first_line
(
0
)
,
first_line
(
0
)
,
selection
(
NOTHING
)
{
{
// determine item size
// determine item size
wxClientDC
dc
(
this
);
wxClientDC
dc
(
this
);
...
...
src/gui/print_window.cpp
View file @
d5e3a027
...
@@ -55,7 +55,7 @@ class TextBufferDC : public wxMemoryDC {
...
@@ -55,7 +55,7 @@ class TextBufferDC : public wxMemoryDC {
double
user_scale_x
,
user_scale_y
;
double
user_scale_x
,
user_scale_y
;
TextDraw
(
wxFont
font
,
Color
color
,
double
user_scale_x
,
double
user_scale_y
,
int
x
,
int
y
,
String
text
,
double
angle
=
0
)
TextDraw
(
wxFont
font
,
Color
color
,
double
user_scale_x
,
double
user_scale_y
,
int
x
,
int
y
,
String
text
,
double
angle
=
0
)
:
font
(
font
),
color
(
color
),
user_scale_x
(
user_scale_x
),
user_scale_y
(
user_scale_y
),
x
(
x
),
y
(
y
),
text
(
text
),
angle
(
angle
)
:
font
(
font
),
color
(
color
),
x
(
x
),
y
(
y
),
text
(
text
),
angle
(
angle
),
user_scale_x
(
user_scale_x
),
user_scale_y
(
user_scale_y
)
{}
{}
};
};
public:
public:
...
@@ -127,8 +127,8 @@ PageLayout::PageLayout(const StyleSheet& stylesheet, const RealSize& page_size)
...
@@ -127,8 +127,8 @@ PageLayout::PageLayout(const StyleSheet& stylesheet, const RealSize& page_size)
card_size
.
width
=
stylesheet
.
card_width
*
25.4
/
stylesheet
.
card_dpi
;
card_size
.
width
=
stylesheet
.
card_width
*
25.4
/
stylesheet
.
card_dpi
;
card_size
.
height
=
stylesheet
.
card_height
*
25.4
/
stylesheet
.
card_dpi
;
card_size
.
height
=
stylesheet
.
card_height
*
25.4
/
stylesheet
.
card_dpi
;
card_landscape
=
card_size
.
width
>
card_size
.
height
;
card_landscape
=
card_size
.
width
>
card_size
.
height
;
cols
=
floor
(
page_size
.
width
/
card_size
.
width
);
cols
=
int
(
floor
(
page_size
.
width
/
card_size
.
width
)
);
rows
=
floor
(
page_size
.
height
/
card_size
.
height
);
rows
=
int
(
floor
(
page_size
.
height
/
card_size
.
height
)
);
// distribute whitespace evenly
// distribute whitespace evenly
margin_left
=
margin_right
=
card_spacing
.
width
=
(
page_size
.
width
-
(
cols
*
card_size
.
width
))
/
(
cols
+
1
);
margin_left
=
margin_right
=
card_spacing
.
width
=
(
page_size
.
width
-
(
cols
*
card_size
.
width
))
/
(
cols
+
1
);
margin_top
=
margin_bottom
=
card_spacing
.
height
=
(
page_size
.
height
-
(
rows
*
card_size
.
height
))
/
(
rows
+
1
);
margin_top
=
margin_bottom
=
card_spacing
.
height
=
(
page_size
.
height
-
(
rows
*
card_size
.
height
))
/
(
rows
+
1
);
...
@@ -228,7 +228,7 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
...
@@ -228,7 +228,7 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
*/
*/
// create buffers
// create buffers
int
w
=
stylesheet
.
card_width
,
h
=
stylesheet
.
card_height
;
// in pixels
int
w
=
int
(
stylesheet
.
card_width
),
h
=
int
(
stylesheet
.
card_height
)
;
// in pixels
if
(
rotation
==
90
)
swap
(
w
,
h
);
if
(
rotation
==
90
)
swap
(
w
,
h
);
// Draw using text buffer
// Draw using text buffer
//TextBufferDC bufferDC(w,h,true);
//TextBufferDC bufferDC(w,h,true);
...
@@ -241,7 +241,7 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
...
@@ -241,7 +241,7 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
// render buffer to device
// render buffer to device
double
px_per_mm
=
4
*
stylesheet
.
card_dpi
/
25.4
;
double
px_per_mm
=
4
*
stylesheet
.
card_dpi
/
25.4
;
dc
.
SetUserScale
(
scale_x
/
px_per_mm
,
scale_y
/
px_per_mm
);
dc
.
SetUserScale
(
scale_x
/
px_per_mm
,
scale_y
/
px_per_mm
);
dc
.
SetDeviceOrigin
(
scale_x
*
pos
.
x
,
scale_y
*
pos
.
y
);
dc
.
SetDeviceOrigin
(
int
(
scale_x
*
pos
.
x
),
int
(
scale_y
*
pos
.
y
)
);
bufferDC
.
drawToDevice
(
dc
,
0
,
0
);
// adjust for scaling
bufferDC
.
drawToDevice
(
dc
,
0
,
0
);
// adjust for scaling
}
}
...
...
src/gui/symbol/symmetry_editor.cpp
View file @
d5e3a027
...
@@ -38,16 +38,16 @@ void SymbolSymmetryEditor::draw(DC& dc) {
...
@@ -38,16 +38,16 @@ void SymbolSymmetryEditor::draw(DC& dc) {
if
(
symmetry
->
kind
==
SYMMETRY_REFLECTION
)
{
if
(
symmetry
->
kind
==
SYMMETRY_REFLECTION
)
{
// draw line to handle
// draw line to handle
dc
.
SetPen
(
wxPen
(
color
,
1
,
wxDOT
));
dc
.
SetPen
(
wxPen
(
color
,
1
,
wxDOT
));
dc
.
DrawLine
(
center
.
x
,
center
.
y
,
handle
.
x
,
handle
.
y
);
dc
.
DrawLine
(
int
(
center
.
x
),
int
(
center
.
y
),
int
(
handle
.
x
),
int
(
handle
.
y
)
);
// draw handle
// draw handle
dc
.
SetPen
(
*
wxBLACK_PEN
);
dc
.
SetPen
(
*
wxBLACK_PEN
);
dc
.
SetBrush
(
color
);
dc
.
SetBrush
(
color
);
dc
.
DrawCircle
(
handle
.
x
,
handle
.
y
,
hovered
==
SELECTION_HANDLE
?
7
:
4
);
dc
.
DrawCircle
(
int
(
handle
.
x
),
int
(
handle
.
y
)
,
hovered
==
SELECTION_HANDLE
?
7
:
4
);
}
}
// draw center
// draw center
dc
.
SetPen
(
*
wxBLACK_PEN
);
dc
.
SetPen
(
*
wxBLACK_PEN
);
dc
.
SetBrush
(
color
);
dc
.
SetBrush
(
color
);
dc
.
DrawCircle
(
center
.
x
,
center
.
y
,
hovered
==
SELECTION_CENTER
?
8
:
5
);
dc
.
DrawCircle
(
int
(
center
.
x
),
int
(
center
.
y
)
,
hovered
==
SELECTION_CENTER
?
8
:
5
);
}
}
}
}
...
...
src/gui/value/package_choice.cpp
View file @
d5e3a027
...
@@ -117,4 +117,4 @@ void PackageChoiceValueEditor::change(const String& c) {
...
@@ -117,4 +117,4 @@ void PackageChoiceValueEditor::change(const String& c) {
void
PackageChoiceValueEditor
::
initDropDown
()
{
void
PackageChoiceValueEditor
::
initDropDown
()
{
if
(
drop_down
)
return
;
if
(
drop_down
)
return
;
drop_down
=
new_shared2
<
DropDownPackageChoiceList
>
(
&
editor
(),
this
);
drop_down
=
new_shared2
<
DropDownPackageChoiceList
>
(
&
editor
(),
this
);
}
}
\ No newline at end of file
src/render/symbol/viewer.cpp
View file @
d5e3a027
...
@@ -21,9 +21,9 @@ Image render_symbol(const SymbolP& symbol, double border_radius, int width, int
...
@@ -21,9 +21,9 @@ Image render_symbol(const SymbolP& symbol, double border_radius, int width, int
double
ar
=
symbol
->
aspectRatio
();
double
ar
=
symbol
->
aspectRatio
();
double
par
=
(
double
)
width
/
height
;
double
par
=
(
double
)
width
/
height
;
if
(
par
>
ar
&&
(
ar
>
1
||
(
allow_smaller
&&
height
<
width
)))
{
if
(
par
>
ar
&&
(
ar
>
1
||
(
allow_smaller
&&
height
<
width
)))
{
width
=
height
*
ar
;
width
=
int
(
height
*
ar
)
;
}
else
if
(
par
<
ar
&&
(
ar
<
1
||
(
allow_smaller
&&
width
<
height
)))
{
}
else
if
(
par
<
ar
&&
(
ar
<
1
||
(
allow_smaller
&&
width
<
height
)))
{
height
=
width
/
ar
;
height
=
int
(
width
/
ar
)
;
}
}
if
(
width
>
height
)
{
if
(
width
>
height
)
{
viewer
.
setZoom
(
width
);
viewer
.
setZoom
(
width
);
...
@@ -354,12 +354,12 @@ void SymbolViewer::highlightPart(DC& dc, const SymbolSymmetry& sym, HighlightSty
...
@@ -354,12 +354,12 @@ void SymbolViewer::highlightPart(DC& dc, const SymbolSymmetry& sym, HighlightSty
double
a
=
angle
+
(
i
+
0.5
)
*
2
*
M_PI
/
copies
;
double
a
=
angle
+
(
i
+
0.5
)
*
2
*
M_PI
/
copies
;
Vector2D
dir
(
cos
(
a
),
sin
(
a
));
Vector2D
dir
(
cos
(
a
),
sin
(
a
));
Vector2D
dir2
=
rotation
.
tr
(
sym
.
center
+
2
*
dir
);
Vector2D
dir2
=
rotation
.
tr
(
sym
.
center
+
2
*
dir
);
dc
.
DrawLine
(
center
.
x
,
center
.
y
,
dir2
.
x
,
dir2
.
y
);
dc
.
DrawLine
(
int
(
center
.
x
),
int
(
center
.
y
),
int
(
dir2
.
x
),
int
(
dir2
.
y
)
);
}
}
// draw center
// draw center
dc
.
SetPen
(
*
wxBLACK_PEN
);
dc
.
SetPen
(
*
wxBLACK_PEN
);
dc
.
SetBrush
(
color
);
dc
.
SetBrush
(
color
);
dc
.
DrawCircle
(
center
.
x
,
center
.
y
,
sym
.
kind
==
SYMMETRY_ROTATION
?
7
:
5
);
dc
.
DrawCircle
(
int
(
center
.
x
),
int
(
center
.
y
)
,
sym
.
kind
==
SYMMETRY_ROTATION
?
7
:
5
);
}
}
void
SymbolViewer
::
highlightPart
(
DC
&
dc
,
const
SymbolGroup
&
group
,
HighlightStyle
style
)
{
void
SymbolViewer
::
highlightPart
(
DC
&
dc
,
const
SymbolGroup
&
group
,
HighlightStyle
style
)
{
...
...
src/render/text/viewer.cpp
View file @
d5e3a027
...
@@ -651,7 +651,7 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
...
@@ -651,7 +651,7 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
}
}
}
}
// how many paragraphs would fit?
// how many paragraphs would fit?
int
n
=
floor
(
0.5
+
(
dc
.
getInternalSize
().
height
-
style
.
padding_bottom
)
/
style
.
paragraph_height
);
int
n
=
int
(
floor
(
0.5
+
(
dc
.
getInternalSize
().
height
-
style
.
padding_bottom
)
/
style
.
paragraph_height
)
);
lines
.
back
().
top
=
max_height
*
n
-
lines
.
back
().
line_height
;
lines
.
back
().
top
=
max_height
*
n
-
lines
.
back
().
line_height
;
}
}
return
lines
.
back
().
bottom
()
<=
dc
.
getInternalSize
().
height
-
style
.
padding_bottom
;
return
lines
.
back
().
bottom
()
<=
dc
.
getInternalSize
().
height
-
style
.
padding_bottom
;
...
...
src/render/value/symbol.cpp
View file @
d5e3a027
...
@@ -35,8 +35,8 @@ void SymbolValueViewer::draw(RotatedDC& dc) {
...
@@ -35,8 +35,8 @@ void SymbolValueViewer::draw(RotatedDC& dc) {
ar
=
min
(
style
().
max_aspect_ratio
,
max
(
style
().
min_aspect_ratio
,
ar
));
ar
=
min
(
style
().
max_aspect_ratio
,
max
(
style
().
min_aspect_ratio
,
ar
));
// render and filter variations
// render and filter variations
FOR_EACH
(
variation
,
style
().
variations
)
{
FOR_EACH
(
variation
,
style
().
variations
)
{
Image
img
=
render_symbol
(
symbol
,
*
variation
->
filter
,
variation
->
border_radius
,
200
*
ar
,
200
);
Image
img
=
render_symbol
(
symbol
,
*
variation
->
filter
,
variation
->
border_radius
,
int
(
200
*
ar
)
,
200
);
Image
resampled
(
(
int
)
(
wh
*
ar
),
(
int
)
wh
,
false
);
Image
resampled
(
int
(
wh
*
ar
),
int
(
wh
)
,
false
);
resample
(
img
,
resampled
);
resample
(
img
,
resampled
);
symbols
.
push_back
(
Bitmap
(
resampled
));
symbols
.
push_back
(
Bitmap
(
resampled
));
}
}
...
...
src/util/io/package.cpp
View file @
d5e3a027
...
@@ -575,4 +575,4 @@ String IncludePackage::typeName() const { return _("include"); }
...
@@ -575,4 +575,4 @@ String IncludePackage::typeName() const { return _("include"); }
IMPLEMENT_REFLECTION
(
IncludePackage
)
{
IMPLEMENT_REFLECTION
(
IncludePackage
)
{
REFLECT_BASE
(
Packaged
);
REFLECT_BASE
(
Packaged
);
}
}
\ No newline at end of file
src/util/io/reader.cpp
View file @
d5e3a027
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
Reader
::
Reader
(
const
InputStreamP
&
input
,
Packaged
*
package
,
const
String
&
filename
,
bool
ignore_invalid
)
Reader
::
Reader
(
const
InputStreamP
&
input
,
Packaged
*
package
,
const
String
&
filename
,
bool
ignore_invalid
)
:
indent
(
0
),
expected_indent
(
0
),
state
(
OUTSIDE
)
:
indent
(
0
),
expected_indent
(
0
),
state
(
OUTSIDE
)
,
package
(
package
),
filename
(
filename
),
line_number
(
0
),
previous_line_number
(
0
)
,
ignore_invalid
(
ignore_invalid
)
,
ignore_invalid
(
ignore_invalid
)
,
filename
(
filename
),
package
(
package
),
line_number
(
0
),
previous_line_number
(
0
)
,
input
(
input
)
,
input
(
input
)
{
{
moveNext
();
moveNext
();
...
@@ -27,10 +27,10 @@ Reader::Reader(const InputStreamP& input, Packaged* package, const String& filen
...
@@ -27,10 +27,10 @@ Reader::Reader(const InputStreamP& input, Packaged* package, const String& filen
Reader
::
Reader
(
Packaged
*
pkg
,
const
String
&
filename
)
Reader
::
Reader
(
Packaged
*
pkg
,
const
String
&
filename
)
:
indent
(
0
),
expected_indent
(
0
),
state
(
OUTSIDE
)
:
indent
(
0
),
expected_indent
(
0
),
state
(
OUTSIDE
)
,
package
(
pkg
),
filename
(
filename
),
line_number
(
0
),
previous_line_number
(
0
)
,
ignore_invalid
(
false
)
,
ignore_invalid
(
false
)
,
filename
(
filename
),
package
(
pkg
),
line_number
(
0
),
previous_line_number
(
0
)
,
input
(
packages
.
openFileFromPackage
(
package
,
filename
))
{
{
input
=
packages
.
openFileFromPackage
(
package
,
filename
);
moveNext
();
moveNext
();
handleAppVersion
();
handleAppVersion
();
}
}
...
@@ -175,7 +175,7 @@ String read_utf8_line(wxInputStream& input, bool eat_bom, bool until_eof) {
...
@@ -175,7 +175,7 @@ String read_utf8_line(wxInputStream& input, bool eat_bom, bool until_eof) {
// convert to string
// convert to string
buffer
.
push_back
(
'\0'
);
buffer
.
push_back
(
'\0'
);
size_t
size
=
wxConvUTF8
.
MB2WC
(
nullptr
,
buffer
.
get
(),
0
);
size_t
size
=
wxConvUTF8
.
MB2WC
(
nullptr
,
buffer
.
get
(),
0
);
if
(
size
==
-
1
)
{
if
(
size
==
size_t
(
-
1
)
)
{
throw
ParseError
(
_
(
"Invalid UTF-8 sequence"
));
throw
ParseError
(
_
(
"Invalid UTF-8 sequence"
));
}
else
if
(
size
==
0
)
{
}
else
if
(
size
==
0
)
{
return
_
(
""
);
return
_
(
""
);
...
...
src/util/reflect.hpp
View file @
d5e3a027
...
@@ -163,7 +163,7 @@
...
@@ -163,7 +163,7 @@
* When reading the first value declared is the default value
* When reading the first value declared is the default value
*
*
* Currently creates the methods:
* Currently creates the methods:
* - Reader::handle(Enum&
* - Reader::handle(Enum&
)
* - Writer::handle(const Enum&)
* - Writer::handle(const Enum&)
* - GetDefaultMember::handle(const Enum&)
* - GetDefaultMember::handle(const Enum&)
*/
*/
...
...
src/util/rotation.cpp
View file @
d5e3a027
...
@@ -286,7 +286,7 @@ void RotatedDC::DrawRoundedRectangle(const RealRect& r, double radius) {
...
@@ -286,7 +286,7 @@ void RotatedDC::DrawRoundedRectangle(const RealRect& r, double radius) {
void
RotatedDC
::
DrawCircle
(
const
RealPoint
&
center
,
double
radius
)
{
void
RotatedDC
::
DrawCircle
(
const
RealPoint
&
center
,
double
radius
)
{
wxPoint
p
=
tr
(
center
);
wxPoint
p
=
tr
(
center
);
dc
.
DrawCircle
(
p
.
x
+
1
,
p
.
y
+
1
,
trS
(
radius
));
dc
.
DrawCircle
(
p
.
x
+
1
,
p
.
y
+
1
,
int
(
trS
(
radius
)
));
}
}
void
RotatedDC
::
DrawEllipticArc
(
const
RealPoint
&
center
,
const
RealSize
&
size
,
double
start
,
double
end
)
{
void
RotatedDC
::
DrawEllipticArc
(
const
RealPoint
&
center
,
const
RealSize
&
size
,
double
start
,
double
end
)
{
...
...
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