Skip to content

[WIP] add CoreGraphics-based text renderer for debugging purposes#15

Open
unstabler wants to merge 4 commits intomainfrom
feature/debug-text
Open

[WIP] add CoreGraphics-based text renderer for debugging purposes#15
unstabler wants to merge 4 commits intomainfrom
feature/debug-text

Conversation

@unstabler
Copy link
Collaborator

Screenshot_20231027_071910-3

TODO

  • add multi-line support
  • clean up code

@unstabler
Copy link
Collaborator Author

#16 완성되면 계속 작업함

@unstabler
Copy link
Collaborator Author

작업 방향

@devadversary 님 안녕하세요,

원래대로라면, 아래 이미지처럼 "\n"을 기준으로 텍스트를 한줄씩 나눠서 draw(ULCGTextRenderer(line).render(), x, y) 같은 형태가 되는걸 생각했었습니다.

image

하지만 xrdp의 비트맵을 그리는 server_paint_rect가 surface의 어느 부분에 그릴지 정하는 dstX, dstY를 지정할 수 없게 되어있기 때문에 위의 방법 대신 다른 방법을 제안드립니다.

  1. ULCGTextRenderer는 생성자에서 ULSurface의 전체 크기와 텍스트를 그릴 dstX, dstY 좌표 위치를 추가로 받습니다.
  2. ULCGTextRenderer는 생성자에서 전달받은 ULSurface의 크기만큼의 이미지를 생성하고, 여기에 텍스트를 그립니다.
  3. ULIPCRect { .x = renderer.x(), .y = renderer.y(), .width = renderer.width(), .height = renderer.height() }ULSurface::drawBitmap()을 호출합니다.

image

횡설수설한 설명이라 정말 죄송합니다 ㅠㅠㅠ
혹시 더 나은 방법이 있다면 제안해 주세요. 🙏

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 13 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant