From 9a85276218929d21698cba980a5cc812e97dc360 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 12:11:32 -0600 Subject: [PATCH] libnxwidgets: In NxWidgets::CText, allow setting negative line spacing. This is useful to have text take up less space, as quite many fonts have large line spacings built-in. --- libnxwidgets/include/ctext.hxx | 6 +++--- libnxwidgets/src/ctext.cxx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libnxwidgets/include/ctext.hxx b/libnxwidgets/include/ctext.hxx index 8f691082d..aa4b303a7 100644 --- a/libnxwidgets/include/ctext.hxx +++ b/libnxwidgets/include/ctext.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/ctext.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -126,7 +126,7 @@ namespace NXWidgets TNxArray m_longestLines; /**< Array containing data describing successively longer wrapped lines */ - uint8_t m_lineSpacing; /**< Spacing between lines of text */ + nxgl_coord_t m_lineSpacing; /**< Spacing between lines of text */ int32_t m_textPixelHeight; /**< Total height of the wrapped text in pixels */ uint8_t m_textPixelWidth; /**< Total width of the wrapped text @@ -216,7 +216,7 @@ namespace NXWidgets * @param lineSpacing The line spacing. */ - void setLineSpacing(uint8_t lineSpacing); + void setLineSpacing(nxgl_coord_t lineSpacing); /** * Sets the pixel width of the text; text wider than diff --git a/libnxwidgets/src/ctext.cxx b/libnxwidgets/src/ctext.cxx index 60b726ca3..fa34079c6 100644 --- a/libnxwidgets/src/ctext.cxx +++ b/libnxwidgets/src/ctext.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/ctext.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -199,7 +199,7 @@ void CText::remove(const int startIndex, const int count) * @param lineSpacing The line spacing. */ -void CText::setLineSpacing(uint8_t lineSpacing) +void CText::setLineSpacing(nxgl_coord_t lineSpacing) { m_lineSpacing = lineSpacing; wrap();