mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-09-22 13:01:05 +03:00
Fix two list-marker issues:
- Decimal/text markers now inherit the current list-item font color. - Marker X/Y coordinates are pixel-snapped, eliminating blurry rendering. - The behavior is shared by <li> and textual <summary> markers. - Added focused tests for inherited color and integer positioning.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include <eepp/ui/uihtmldetails.hpp>
|
||||
#include <eepp/ui/uihtmlimage.hpp>
|
||||
#include <eepp/ui/uihtmlinput.hpp>
|
||||
#include <eepp/ui/uihtmlliststyle.hpp>
|
||||
#include <eepp/ui/uihtmltable.hpp>
|
||||
#include <eepp/ui/uihtmltextarea.hpp>
|
||||
#include <eepp/ui/uihtmltextinput.hpp>
|
||||
@@ -2402,6 +2403,25 @@ UTEST( UILayout, listStyleTypeDecimal ) {
|
||||
Engine::destroySingleton();
|
||||
}
|
||||
|
||||
UTEST( UILayout, textListMarkerTracksInheritedColor ) {
|
||||
FontStyleConfig inheritedStyle;
|
||||
inheritedStyle.FontColor = Color( 224, 230, 237 );
|
||||
inheritedStyle.CharacterSize = 19;
|
||||
|
||||
Text marker;
|
||||
marker.setString( "1." );
|
||||
UIHTMLListStyle::syncTextMarkerColor( marker, inheritedStyle.FontColor );
|
||||
|
||||
EXPECT_TRUE( marker.getFillColor() == inheritedStyle.FontColor );
|
||||
}
|
||||
|
||||
UTEST( UILayout, textListMarkerPositionIsPixelAligned ) {
|
||||
const Vector2f markerPos = UIHTMLListStyle::getTextMarkerPosition(
|
||||
{ 100.75f, 40.5f }, Rectf( 0.25f, 1.75f, 0.f, 0.f ), 12.4f, 17.f );
|
||||
|
||||
EXPECT_TRUE( markerPos == markerPos.floor() );
|
||||
}
|
||||
|
||||
UTEST( UILayout, listStyleTypeDisc ) {
|
||||
init_ui_test();
|
||||
auto* sceneNode = SceneManager::instance()->getUISceneNode();
|
||||
|
||||
Reference in New Issue
Block a user