diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-11-09 18:18:15 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-11-13 11:16:56 +0100 |
commit | 66bbf08f08dafe38c02edbca11ca01e7906d4b81 (patch) | |
tree | 55573da535ab3cbeef748014cc8e530f9baf861f /libreofficekit | |
parent | 71f9961488232697bcdb37db349569a20f15bb2d (diff) |
lok: calc: switch row / column / grouping data to pixels.
This simplifies lots of logic in the clients, making it trivial to get
good row/column header alignment at any zoom. Ultimately TWIPS here are
highly misleading print-twips, and in this state are ~impossible to map
to pixels accurately unless all data is present back to the origin
(which is not the current approach).
Change-Id: I6ca30e77865b62e886e23860f7c23350e544c9fc
Reviewed-on: https://gerrit.libreoffice.org/82572
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx index 9346057b7d01..ee75100464f3 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx @@ -114,7 +114,7 @@ static gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCair if (priv->m_eType == CalcHeaderType::ROW) { aRectangle.x = 0; - aRectangle.y = nPrevious - 1; + aRectangle.y = nPrevious; aRectangle.width = ROW_HEADER_WIDTH - 1; aRectangle.height = rHeader.m_nSize - nPrevious; // Left line. @@ -129,7 +129,7 @@ static gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCair } else if (priv->m_eType == CalcHeaderType::COLUMN) { - aRectangle.x = nPrevious - 1; + aRectangle.x = nPrevious; aRectangle.y = 0; aRectangle.width = rHeader.m_nSize - nPrevious; aRectangle.height = COLUMN_HEADER_HEIGHT - 1; @@ -179,7 +179,6 @@ gtv_calc_header_bar_class_init(GtvCalcHeaderBarClass* klass) void gtv_calc_header_bar_configure(GtvCalcHeaderBar* bar, const boost::property_tree::ptree* values) { - GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(bar))); GtvCalcHeaderBarPrivate& priv = getPrivate(bar); priv->m_aHeaders.clear(); @@ -190,7 +189,7 @@ void gtv_calc_header_bar_configure(GtvCalcHeaderBar* bar, const boost::property_ { for (const boost::property_tree::ptree::value_type& rValue : val) { - int nSize = std::round(lok_doc_view_twip_to_pixel(LOK_DOC_VIEW(window->lokdocview), std::atof(rValue.second.get<std::string>("size").c_str()))); + int nSize = std::round(std::atof(rValue.second.get<std::string>("size").c_str())); if (nSize >= bar->m_nPositionPixel) { const int nScrolledSize = nSize - bar->m_nPositionPixel; |