Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
addc7e82
Kaydet (Commit)
addc7e82
authored
May 21, 2014
tarafından
Markus Mohrhard
Kaydeden (comit)
Markus Mohrhard
May 21, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
we need to set text size in woorld coordinates
Change-Id: If77133080851a3b2d700ac54c9722f560e71f26e
üst
705c26a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
GL3DBarChart.cxx
chart2/source/view/charttypes/GL3DBarChart.cxx
+15
-6
No files found.
chart2/source/view/charttypes/GL3DBarChart.cxx
Dosyayı görüntüle @
addc7e82
...
@@ -42,6 +42,17 @@ GL3DBarChart::~GL3DBarChart()
...
@@ -42,6 +42,17 @@ GL3DBarChart::~GL3DBarChart()
mrWindow
.
setRenderer
(
NULL
);
mrWindow
.
setRenderer
(
NULL
);
}
}
namespace
{
const
float
TEXT_HEIGHT
=
10.0
f
;
float
calculateTextWidth
(
const
OUString
&
rText
)
{
return
rText
.
getLength
()
*
5.0
;
}
}
void
GL3DBarChart
::
create3DShapes
(
const
boost
::
ptr_vector
<
VDataSeries
>&
rDataSeriesContainer
,
void
GL3DBarChart
::
create3DShapes
(
const
boost
::
ptr_vector
<
VDataSeries
>&
rDataSeriesContainer
,
ExplicitCategoriesProvider
&
rCatProvider
)
ExplicitCategoriesProvider
&
rCatProvider
)
{
{
...
@@ -88,13 +99,12 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
...
@@ -88,13 +99,12 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
maShapes
.
push_back
(
new
opengl3D
::
Text
(
mpRenderer
.
get
(),
aSeriesName
,
nId
++
));
maShapes
.
push_back
(
new
opengl3D
::
Text
(
mpRenderer
.
get
(),
aSeriesName
,
nId
++
));
opengl3D
::
Text
*
p
=
static_cast
<
opengl3D
::
Text
*>
(
&
maShapes
.
back
());
opengl3D
::
Text
*
p
=
static_cast
<
opengl3D
::
Text
*>
(
&
maShapes
.
back
());
Size
aTextSize
=
p
->
getSize
();
glm
::
vec3
aTopLeft
,
aTopRight
,
aBottomRight
;
glm
::
vec3
aTopLeft
,
aTopRight
,
aBottomRight
;
aTopLeft
.
x
=
aTextSize
.
getWidth
(
)
*
-
1.0
;
aTopLeft
.
x
=
calculateTextWidth
(
aSeriesName
)
*
-
1.0
;
aTopLeft
.
y
=
nYPos
;
aTopLeft
.
y
=
nYPos
;
aTopRight
.
y
=
nYPos
;
aTopRight
.
y
=
nYPos
;
aBottomRight
=
aTopRight
;
aBottomRight
=
aTopRight
;
aBottomRight
.
y
+=
aTextSize
.
getHeight
()
;
aBottomRight
.
y
+=
TEXT_HEIGHT
;
p
->
setPosition
(
aTopLeft
,
aTopRight
,
aBottomRight
);
p
->
setPosition
(
aTopLeft
,
aTopRight
,
aBottomRight
);
sal_Int32
nColor
=
aSeriesColor
[
nSeriesIndex
%
SAL_N_ELEMENTS
(
aSeriesColor
)].
GetColor
();
sal_Int32
nColor
=
aSeriesColor
[
nSeriesIndex
%
SAL_N_ELEMENTS
(
aSeriesColor
)].
GetColor
();
...
@@ -164,13 +174,12 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
...
@@ -164,13 +174,12 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
maShapes
.
push_back
(
new
opengl3D
::
Text
(
mpRenderer
.
get
(),
aCats
[
i
],
nId
++
));
maShapes
.
push_back
(
new
opengl3D
::
Text
(
mpRenderer
.
get
(),
aCats
[
i
],
nId
++
));
opengl3D
::
Text
*
p
=
static_cast
<
opengl3D
::
Text
*>
(
&
maShapes
.
back
());
opengl3D
::
Text
*
p
=
static_cast
<
opengl3D
::
Text
*>
(
&
maShapes
.
back
());
Size
aTextSize
=
p
->
getSize
();
aTopLeft
.
x
=
nXPos
;
aTopLeft
.
x
=
nXPos
;
aTopLeft
.
y
=
nYPos
;
aTopLeft
.
y
=
nYPos
;
aTopRight
=
aTopLeft
;
aTopRight
=
aTopLeft
;
aTopRight
.
x
+=
aTextSize
.
getWidth
(
);
aTopRight
.
x
+=
calculateTextWidth
(
aCats
[
i
]
);
aBottomRight
=
aTopRight
;
aBottomRight
=
aTopRight
;
aBottomRight
.
y
+=
aTextSize
.
getHeight
()
;
aBottomRight
.
y
+=
TEXT_HEIGHT
;
p
->
setPosition
(
aTopLeft
,
aTopRight
,
aBottomRight
);
p
->
setPosition
(
aTopLeft
,
aTopRight
,
aBottomRight
);
}
}
}
}
...
...
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