← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff into lp:widelands.

Commit message:
Removed texture size restrictions from editboxes. We no longer need them thanks to the RenderedText class.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1741779 in widelands: "Editor: Description is cut in map options multilineeditbox"
  https://bugs.launchpad.net/widelands/+bug/1741779

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff/+merge/345495
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff into lp:widelands.
=== modified file 'src/ui_basic/editbox.cc'
--- src/ui_basic/editbox.cc	2018-04-27 06:11:05 +0000
+++ src/ui_basic/editbox.cc	2018-05-14 08:00:19 +0000
@@ -97,8 +97,7 @@
 	m_->caret = 0;
 	m_->scrolloffset = 0;
 	// yes, use *signed* max as maximum length; just a small safe-guard.
-	m_->maxLength =
-	   std::min(g_gr->max_texture_size() / UI_FONT_SIZE_SMALL, std::numeric_limits<int32_t>::max());
+	m_->maxLength = std::numeric_limits<int32_t>::max();
 
 	set_handle_mouse(true);
 	set_can_focus(true);

=== modified file 'src/ui_basic/multilineeditbox.cc'
--- src/ui_basic/multilineeditbox.cc	2018-05-13 07:15:39 +0000
+++ src/ui_basic/multilineeditbox.cc	2018-05-14 08:00:19 +0000
@@ -97,7 +97,7 @@
      background_style(style),
      cursor_pos(0),
      lineheight(text_height()),
-     maxbytes(std::min(g_gr->max_texture_size() / UI_FONT_SIZE_SMALL, 0xffff)),
+     maxbytes(std::numeric_limits<int32_t>::max()),
      ww_valid(false),
      owner(o) {
 	scrollbar.moved.connect(boost::bind(&MultilineEditbox::scrollpos_changed, &o, _1));
@@ -133,8 +133,7 @@
 		d_->erase_bytes(d_->prev_char(d_->text.size()), d_->text.size());
 	}
 
-	d_->set_cursor_pos(d_->text.size());
-
+	d_->set_cursor_pos(0);
 	d_->update();
 	d_->scroll_cursor_into_view();
 


Follow ups