1 --- src/3rdparty/chromium/ui/gfx/render_text.cc.orig 2021-12-15 16:12:54 UTC 2 +++ src/3rdparty/chromium/ui/gfx/render_text.cc 3 @@ -1191,32 +1191,33 @@ void RenderText::SetDisplayOffset(int horizontal_offse 4 const int extra_content = GetContentWidth() - display_rect_.width(); 5 const int cursor_width = cursor_enabled_ ? 1 : 0; 6 7 - int min_offset = 0; 8 - int max_offset = 0; 9 + // avoid collisions with vm_map.h on FreeBSD --cmt 10 + int _min_offset = 0; 11 + int _max_offset = 0; 12 if (extra_content > 0) { 13 switch (GetCurrentHorizontalAlignment()) { 14 case ALIGN_LEFT: 15 - min_offset = -extra_content; 16 + _min_offset = -extra_content; 17 break; 18 case ALIGN_RIGHT: 19 - max_offset = extra_content; 20 + _max_offset = extra_content; 21 break; 22 case ALIGN_CENTER: 23 // The extra space reserved for cursor at the end of the text is ignored 24 // when centering text. So, to calculate the valid range for offset, we 25 // exclude that extra space, calculate the range, and add it back to the 26 // range (if cursor is enabled). 27 - min_offset = -(extra_content - cursor_width + 1) / 2 - cursor_width; 28 - max_offset = (extra_content - cursor_width) / 2; 29 + _min_offset = -(extra_content - cursor_width + 1) / 2 - cursor_width; 30 + _max_offset = (extra_content - cursor_width) / 2; 31 break; 32 default: 33 break; 34 } 35 } 36 - if (horizontal_offset < min_offset) 37 - horizontal_offset = min_offset; 38 - else if (horizontal_offset > max_offset) 39 - horizontal_offset = max_offset; 40 + if (horizontal_offset < _min_offset) 41 + horizontal_offset = _min_offset; 42 + else if (horizontal_offset > _max_offset) 43 + horizontal_offset = _max_offset; 44 45 cached_bounds_and_offset_valid_ = true; 46 display_offset_.set_x(horizontal_offset); 47