Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[2e] Replace hardcoded _setup(893, 1117) with ARFset constructor options

Đang mở Phù hợp với người mới
#24 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript
Lĩnh vực
frontend, web-dev

Hướng nghiên cứu

Bắt đầu tại src/ARFset.js:249-251 bằng cách đọc constructor của ARFset và lời gọi _setup của nó. Thêm các tùy chọn width và height tùy chọn trong khi vẫn giữ các giá trị mặc định 893 × 1117, sau đó xem lại example/example.html và example_es6.html để đảm bảo cách sử dụng constructor của chúng phản ánh hành vi dự kiến.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

Replace hardcoded _setup(893, 1117) magic numbers with configurable ARFset constructor options

Environment

  • Product/Service: FeatureSET-Display — JavaScript API
  • File: src/ARFset.js:249-251

Problem Description

The ARFset constructor calls _setup(893, 1117) with hardcoded canvas dimensions. These magic numbers are undocumented, cannot be overridden by callers, and do not reflect real use-case canvas sizes. Any application needing a different canvas size must patch the source.

Expected Behavior

The ARFset constructor accepts an optional { width, height } options object with sensible defaults (e.g. { width: 893, height: 1117 } to maintain existing behavior). Callers can override dimensions without modifying the library.

Actual Behavior

Canvas dimensions are hardcoded in the constructor; no way for callers to specify a different size.

Tasks

  • Accept { width, height } in the ARFset constructor with defaults matching current hardcoded values
  • Pass the options through to _setup(width, height)
  • Update example HTML files (example/example.html, example_es6.html) to explicitly pass dimensions or rely on defaults

Impact

Low — Usability improvement; no functional regression. Current defaults preserve existing behavior.

Additional Context

This is a non-breaking change if defaults match current hardcoded values (893 × 1117). Consider also accepting a single canvas element reference as an alternative constructor signature to read dimensions from the DOM element directly.

Ngôn ngữ chính
JavaScript
Star
8
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của webarkit/FeatureSET-Display

Tất cả issue của webarkit/FeatureSET-Display

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.